Cropping images

      Last updated June 29, 2018

    Region crop

    Crop the image to 150px by 100px.

    https://www.fastly.io/image.jpg?crop=150,100

    alt text

    Aspect ratio crop

    Crop the image to an aspect ratio of 16:9.

    https://www.fastly.io/image.jpg?crop=16:9

    alt text

    Region crop and sub region

    Crop the image to 150px by 100px and also select 50px as the starting sub region x coordinate and 50px as the sub region y coordinate.

    https://www.fastly.io/image.jpg?crop=150,100,x50,y50

    alt text

    Aspect ratio crop and offset

    Crop the image square and offset the x-axis 25% and the y-axis 50%.

    https://www.fastly.io/image.jpg?crop=1:1,offset-x0.25,offset-y0.50

    alt text

    Aspect ratio crop (with width)

    Crop the image square and resize the width to 200px.

    https://www.fastly.io/image.jpg?crop=1:1&width=200

    alt text

    Smart cropping (with trim and width)

    Smart crop the image square, trim all edges by 30% and resize the width to 200px.

    https://www.fastly.io/mountaineer.jpg?trim=0.30&width=200&crop=1:1,smart

    alt text

    This article describes a product that may use third-party cloud infrastructure to process or store content or requests for content. For more information, see our cloud infrastructure security and compliance program.
    Back to Top