Skip to main content

Page last updated 07 October 2026

The crop mode defines how the image should be scaled and aligned when the fit=crop parameter is set. The width and height parameters set both the crop dimensions and initial resize of the image. The whole image is scaled until it covers the box you asked for, then whatever overflows is trimmed away, so the image always comes back at the exact dimensions specified and some of the original is cut off.

Only one direction is ever trimmed, and which one depends on the shape of the box rather than on the image. The examples below all start from the same 3724 x 2483 landscape photograph: a square box trims its width, and a letterbox box trims its height.

Valid values for the crop position are top, bottom, left, right. If no value is explicitly set, the default behavior is to crop from the center of the image.

A fit applies to the resize immediately before it, so give it after both dimensions: in ?fit=crop&width=200&height=200 the fit has no resize to act on and the image is not cropped. A crop fit also needs both a width and a height. Given only one, such as ?width=200&fit=crop, it cannot form a crop and the image is returned at its original size.


Crop from center

A square box out of a landscape photograph keeps the full height and trims the width evenly from both sides.

The coastal landscape cropped to a square from the centre, with the lighthouse near the right edge

Crop from top

A letterbox box is wider in proportion than the photograph, so here it is the height that is trimmed. Cropping from the top keeps the sky and discards the shoreline.

A wide banner taken from the top of the coastal landscape, showing only sky and cloud

Crop from bottom

The same letterbox box taken from the bottom instead keeps the rocks and the water.

A wide banner taken from the bottom of the coastal landscape, showing the rocky shoreline and water

Crop from left

Back to the square box, where the width is trimmed. Cropping from the left takes the trim off the right-hand side, and the lighthouse is lost.

The coastal landscape cropped to a square from the left, with the lighthouse cut off

Crop from right

Cropping the same square from the right keeps the lighthouse and the headland, and loses the rocks on the far left.

The coastal landscape cropped to a square from the right, keeping the lighthouse and the headland

A crop fit is not an anchored crop

A crop fit and an anchored crop both return an image at the exact size you ask for, but they get there in opposite ways. A crop fit scales the whole image down until it covers the box and then trims the overflow, so you keep the whole scene at a smaller size. An anchored crop takes a rectangle of the original pixels at their original scale, so you keep the detail and lose everything outside the rectangle.

Both requests below return a 600 x 400 image from the same 3724 x 2483 photograph.

The whole coastal scene scaled down to 600 by 400

fit=crop keeps the whole scene.

A 600 by 400 rectangle of original pixels taken from the centre of the photograph, showing only sky and sea

crop=600,400,center returns 600 x 400 of the original pixels, which at this size is a small patch of sky and sea from the middle of the photograph.

Still need help?

If you still need help after reading this article, don't hesitate to reach out to the Contensis community on Slack or raise a support ticket to get help from our team.
New support request