Skip to content

Image Transformation API

If an uploaded file is an image, you can transform it on the fly just adding query string parameters.



The width of the output image. Value is a positive integer, interpreted as pixel width. The resulting image will be width pixels wide.

If only one dimension is specified, the other dimension will be calculated according to the aspect ratio of the input image. If both width and height are omitted, then the source image's dimensions are used.



The same as width:



The fit parameter controls how the output image is fit to its target dimensions after resizing.

Valid values are clip, scale. The default value is clip.


Default. Resizes the image to fit within the width and height boundaries without cropping or distorting the image. The resulting image will match one of the constraining dimensions, while the other dimension is altered to maintain the same aspect ratio of the input image.

clip illustration


Scales the image to fit the constraining dimensions exactly. The resulting image will fill the dimensions, and will not maintain the aspect ratio of the input image.

scale illustration


Controls the output quality of lossy file formats (jpg, pjpg, webp, or jxr).

Valid values are in the range 0 – 100 and the default is 75. Quality can often be set much lower than the default, especially when serving high-DPR images