Image Processor URL parameters
Look up every ims query string operation: resize, crop, rotate, quality, watermark, format conversion, and fill, with the values each one accepts.
The ims query string carries the transformation Image Processor applies to an image. One string can hold a resize, a crop, and a chain of filters. Image Processor returns a derived image built from the source image on the origin, and it reads the source image without changing it. This page carries the syntax of each operation, the values its arguments accept, and a rendered result.
Resize
A resize sets the size of the derived image. The size goes in the query string as ?ims=WidthxHeight, in pixels, and either dimension can be left out.
| Argument | Type | Required | Default | What it does |
|---|---|---|---|---|
Width |
Whole number of pixels, or orig |
No | Calculated from Height, with the aspect ratio preserved |
Sets the width of the derived image. orig keeps the original width. |
Height |
Whole number of pixels, or orig |
No | Calculated from Width, with the aspect ratio preserved |
Sets the height of the derived image. orig keeps the original height. |
When both Width and Height are set, the image may be cropped automatically to fit the requested size. The crop is centered, and it runs vertically or horizontally depending on how the original dimensions fit the requested ones.
The arguments combine into five forms:
| Form | Result |
|---|---|
?ims=WidthxHeight |
Resizes the image to that size. The image may be autocropped to fit. |
?ims=Widthx |
Sets the width and calculates the height, with the aspect ratio preserved. |
?ims=xHeight |
Sets the height and calculates the width, with the aspect ratio preserved. |
?ims=Widthxorig |
Sets the width and keeps the original height. |
?ims=fit-in/WidthxHeight |
Fits the image inside the area, with the aspect ratio preserved and no enlargement. |
Image Processor does not honor orig on every URL: some requests that carry it return the source image without a transformation.
Without fit-in, a requested size larger than the source image enlarges it: ?ims=1200x, ?ims=x900, and ?ims=1200x900 all return an image larger than the source. To keep the original size when the requested size is larger, use fit-in.
fit-in never enlarges the image: when the area is larger than the image dimensions, the image keeps its original size. Both dimensions are optional, and the image is scaled down until it fits the width or the height, whichever it reaches first. For example, ?ims=fit-in/400x400 on a landscape image stops at 400 pixels of width, and the height lands below 400.
The image below carries ?ims=400x400, which resizes with autocrop:

Crop
A crop keeps the rectangle between two coordinates of the source image and discards the rest. The coordinates go in the query string as ?ims=AxB:CxD, in pixels.
| Argument | Type | Required | What it does |
|---|---|---|---|
AxB |
Coordinate pair in pixels | Yes | The upper-left corner where the crop starts. |
CxD |
Coordinate pair in pixels | Yes | The bottom-right corner where the crop ends. |
For example, ?ims=430x20:800x500 starts the crop at the coordinate 430x20 pixels and ends it at the coordinate 800x500 pixels.
The image below carries that query:

Rotation
Rotation turns the image to the left by a fixed number of degrees. The angle goes in the query string as ?ims=filters:rotate(Angle).
| Argument | Type | Required | What it does |
|---|---|---|---|
Angle |
One of 0, 90, 180, 270, 360 |
Yes | The number of degrees the image turns to the left. |
| Value | Result |
|---|---|
0 |
No rotation. |
90 |
Turns the image 90 degrees to the left. |
180 |
Turns the image 180 degrees to the left. |
270 |
Turns the image 270 degrees to the left. |
360 |
No rotation. |
A value that is not on this list does not rotate the image.
The image below carries ?ims=filters:rotate(270):
)
Quality
The quality filter sets the compression of the derived image, which changes the file size and the transfer time. The value goes in the query string as ?ims=filters:quality(value).
| Argument | Type | Required | What it does |
|---|---|---|---|
value |
Whole number, 0 to 100 |
Yes | The quality of the derived image. 0 compresses it the most, and 100 the least. |
The recommended value is 85. It optimizes the image with no noticeable loss of visual quality.
The image below carries ?ims=filters:quality(15), far below the recommended value:
)
Watermark
A watermark places a second image over the source image. The filter goes in the query string as ?ims=filters:watermark(WatermarkURL,X,Y,Alpha) and takes four arguments, in that order.
| Argument | Type | Required | What it does |
|---|---|---|---|
WatermarkURL |
URL of an image | Yes | The image placed over the source image. |
X |
Whole number of pixels, center, or repeat |
Yes | The horizontal position. |
Y |
Whole number of pixels, center, or repeat |
Yes | The vertical position. |
Alpha |
Whole number, 0 to 100 |
Yes | The transparency of the watermark. 0 is completely opaque and 100 is completely transparent. |
A positive X offsets the watermark from the left edge, and a negative X offsets it from the right edge. A positive Y offsets it from the top edge, and a negative Y offsets it from the bottom edge. center centers it on that axis, and repeat fills the image with copies of it along that axis. Parentheses in WatermarkURL are encoded as %28 for ( and %29 for ).
For example, ?ims=filters:watermark(https://example.com/watermark-image.png,-25,-10,50) places the watermark 25 pixels from the right edge and 10 pixels from the bottom edge, at 50% transparency.
The image below carries a watermark centered on both axes, at 50% transparency:
)
Format conversion
Format conversion returns the image in a different file format. The target format goes in the query string as ?ims=filters:format(ImageFormat).
| Argument | Type | Required | What it does |
|---|---|---|---|
ImageFormat |
One of webp, avif, jpeg, gif, png |
Yes | The file format of the derived image. |
The response carries the format the filter names, whatever Accept header the request carries. A browser that does not support WEBP or AVIF cannot display it.
The image below carries ?ims=filters:format(gif):
)
Fill
Fill fits the image inside an area of the requested size and paints the rest of the area with one color. The derived image takes the size of the area. The filter goes in the query string as ?ims=fit-in/WidthxHeight/filters:fill(Color).
| Argument | Type | Required | What it does |
|---|---|---|---|
Width |
Whole number of pixels | No | The width of the area the image fits into. |
Height |
Whole number of pixels | No | The height of the area the image fits into. |
Color |
Hexadecimal color value, or the named value gray |
Yes | The color painted around the image. |
If you omit Width or Height, the omitted dimension is calculated from the other, with the aspect ratio preserved. Fill uses the same fit-in behavior as a resize: the image keeps its aspect ratio, and an area larger than the image does not enlarge it. The space left over is what the color fills.
For example, ?ims=fit-in/300x400/filters:fill(008080) fits the image into an area of 300 by 400 pixels and paints the space around it with the color 008080.
The image below carries ?ims=fit-in/400x400/filters:fill(gray):
)
Combined filters
One ims string can carry more than one filter. The filters go inside a single filters: group, and a : separates each one from the next, as in filters:filter1(arg1):filter2(arg2).
| Segment | Example | What it does |
|---|---|---|
| Resize segment | fit-in/400x400 |
Sets the size of the derived image. |
| Filter group | filters:fill(00ffff):quality(100) |
Carries one or more filters, opened by filters:. |
| Filter separator | : |
Separates one filter from the next inside the group. |
The resize segment comes first, and a / separates it from the filter group. For example, ?ims=fit-in/400x400/filters:fill(00ffff):quality(100) fits the image into an area of 400 by 400 pixels. It then paints the space around the image with the color 00ffff and applies a quality value of 100.
The image below carries that query:
:quality(100))
Supported input formats
Image Processor accepts these source image formats:
- JPEG
- GIF
- PNG
- BMP
- ICO
- WEBP
- AVIF
A browser displays a WEBP or AVIF derived image only when it supports that format. For the browsers that support each one, refer to WEBP browser support and AVIF browser support.
Image Processor also converts a format with no ims parameter in the request. It detects which formats the browser supports and, when possible, converts the image to one of them, such as WEBP or AVIF. BMP images are converted to JPEG or WEBP depending on the same browser support. For more information, refer to Image delivery.
Position of the ims parameter
ims can sit anywhere in the query string: example.com/image.jpeg?ims=1000x1000&ts=1234 and example.com/image.jpeg?ts=1234&ims=1000x1000 return the same derived image. An ims value that Image Processor cannot parse, such as 450xOrig, returns the source image without a transformation, still with x-ims: Enabled.