Documentation Center

Chaining image transformation commands

To perform multiple image transformations in sequence to the same image, append one command after the other after your image transformation URL, and put the target image at the end. Note that format conversion (if used) must always be the last command in the chain.

Procedure

  1. Append a command for one transformation after your image transformation URL, but omit the image. For example:
    • To trim an image by 200 pixels from all sides, add /trim/200px/ to the URL.
    • To scale an image to 100 by 100 pixels, add /scale/100x100/ to the URL.
  2. Append a command for another transformation after the resulting URL, including the image. For example:
    • To trim an image by 200 pixels from all sides, then scale the result to 250 by 350 pixels, add /trim/200px/scale/250x350/example.jpg to the URL.
    • To scale an image to 100 by 100 pixels, then convert it to PNG format, add /scale/100x100/www.example.com/images/example.jpg/to/example.png to the URL.