# Image QueryString API

The commands available are documented into the following categories:

* [Image Transforms](https://docs.spectrumcustomizer.com/integration/api/image-querystring-api/image-transforms)
* [Image Filters](https://docs.spectrumcustomizer.com/integration/api/image-querystring-api/image-filters)
* [Image Encoding](https://docs.spectrumcustomizer.com/integration/api/image-querystring-api/image-encoding)

## Usage

```
/api/assets/generated/recipeSet/readable/L83NJTB7/east?width=400&height=400
```

{% hint style="info" %}
Note: the order of QueryString parameters does not affect output.  The are evaluated in the most efficient operations regardless of order.
{% endhint %}

## Examples

\
​[https://api.spectrumcustomizer.com/api/assets/generated/recipeSet/readable/L83NJTB7/east?**width=250\&height=250**](https://api.spectrumcustomizer.com/api/assets/generated/recipeSet/readable/L83NJTB7/east?width=150\&height=150\&bgcolor=CCCCCC)

<div align="left"><img src="https://1811859013-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MOmLkb6vlSytNPs-CSy%2F-MSBZxAsdW6cB8PGXDzV%2F-MSBgvZeFkIjleJ6LLUP%2F250.png?alt=media&#x26;token=5651bb39-241c-41be-b697-a7e96fa04dae" alt="?width=250&#x26;height=250"></div>

[https://api.spectrumcustomizer.com/api/assets/generated/recipeSet/readable/L83NJTB7/east?**width=150\&height=150\&bgcolor=CCCCCC**](https://api.spectrumcustomizer.com/api/assets/generated/recipeSet/readable/L83NJTB7/east?width=150\&height=150\&bgcolor=CCCCCC)

<div align="left"><img src="https://1811859013-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MOmLkb6vlSytNPs-CSy%2F-MSBZxAsdW6cB8PGXDzV%2F-MSBjmR4HWvNzwSGJElc%2F150.png?alt=media&#x26;token=9f7e8c8d-16bb-4b1a-884f-a9bc1e585dd2" alt="?width=150&#x26;height=150&#x26;bgcolor=CCCCCC"></div>

### Other Examples

* `width=100&height=100&mode=max&scale=down` ensures the image is downscaled to 100x100 or less, but does not upscale the image if it is already smaller than that. Aspect ratio is maintained.
* `width=200&height=200&mode=max&scale=both` ensures the image is downscaled or upscaled to fit within 200x200, maintaining aspect ratio.
* `width=200&height=200&mode=pad&scale=both` ensures the image is downscaled or upscaled to fit within 200x200, maintaining aspect ratio, then is padded to make the result always 200x200.
* `width=300&height=300&mode=crop&scale=both` ensures the image is downscaled or upscaled to fit around 300x300, then minimally cropped to meet the aspect ratio. `scale=both` ensures the image is upscaled if smaller so the result is always 300x300.
