ScaleCommerce Image API

Server for resizing and converting images based on imgproxy. This page only shows some basic examples, see full documentation for all features. We do not allow fetching images from any domain. The team at [email protected] will set up your image domain. After that use /_img/ as a placeholder in the image url for your fetch domain.

Resize and keep aspect ratio

The url command for resizing and keeping the aspect ratio of the original image is /rs:fit:<width>:<height>/. This will use the bigger value (width or height) of the original image and scale this to the corresponding value from the url command. For landscape format images this means the width of the resized image will match the width value from the url and the height will be calculated according to the aspect ratio. For portait format images the height will match the url command.

/rs:fit:640:480/_img/original.jpg
Landscape format Portrait format
640 x ??? ??? x 480
/rs:fit:640:480/ /rs:fit:640:480/

Resize and extend image to match exact size

This is useful if you need to create a square image from rectangular source images. Basically the url commands are the same as above, you just need to add /ex:1/ to extend the image and configure /bg:<hex color>/ to which color should be used.

/rs:fit:350:350/ex:1/bg:ffffff/_img/original.jpg
Landscape format Portrait format
350 x 350 350 x 350
rs:fit:350:350/ex:1/bg:ffffff/ rs:fit:350:350/ex:1/bg:ffffff/

Convert source image to different output format

You can convert source images on the fly to png, jgp, webp, avif and many more with the /format:<FORMAT>/ command. For the full list of supported source and result formats see Image format support.

/format:<FORMAT>/_img/original.jpg
JPG (9 KB) PNG (57 KB)
rs:fit:350:350/ex:1/bg:ffffff/format:jpg/ rs:fit:350:350/ex:1/bg:ffffff/format:png/
WEBP (5 KB)
(suported Browsers)
AFIV (3 KB)
(suported Browsers)
rs:fit:350:350/ex:1/bg:ffffff/format:webp/ rs:fit:350:350/ex:1/bg:ffffff/format:avif/

Set quality

Output quality can be controlled with the /q:<0-100>/ or with the /max_bytes:<BYTES> commands. max_bytes is only applicable to jpg, webp, heic and tiff.

/q:90/ /max_bytes:12288/
/rs:fit:640:480/q:90/ /rs:fit:640:480/max_bytes:12288/