Crop

You can crop images by entering coordinates for where the boundary of the crop will be.

Note: The maximum accepted image size is 100,000,000 pixels. An image with this many pixels could have width and height combinations like 10,000 x 10,000 or 5,000 x 20,000, etc. There is also a file size restriction. Filestack will not convert an image that is larger than 256mb. Please contact us if you require the ability to process larger files than our current limits.

Crop Task URL Formats:
https://process.filestackapi.com/crop=[options]/Filestack_FileLink_Handle
or
https://process.filestackapi.com/<API_KEY>/crop=[options]/File_URL
crop=dim:[x,y,width,height]
Integer

Can be abbreviated as d:[10,20,200,250]

Crops the image to a specified rectangle.

The input for this parameter must be exactly 4 integers: 'x coordinate,y coordinate,width,height'. For example, an input of crop=dim:[10,20,200,250] selects a 200x250 pixel rectangle starting 10 pixels from the left edge of the image and 20 pixels from the top edge of the image.

How the Cropping Function Works

The X and Y coordinates start from [0,0] and correspond to the top left hand corner of the image to be cropped. The Width and Height parameters dictate the size in pixels of the cropping rectangle once the point to start the crop at is selected by the X and Y coordinates. If you set coordinates that create a crop area that extends outside the frame of the image, then you will only receive back the part of the image that is within the crop area.

Example image demonstrating how the Filestack cropping function works

Example image demonstrating how the Filestack cropping function works if the crop area extends outside the image

Crop Examples

Original Image

original photo to be cropped using Filestack's image transformations

Illustration of the crop area created by adding the crop parameters crop=dim:[2000,900,1800,1300].

The crop area starts 2000 pixels in and 900 pixels down which is the top left corner of the rectangle.
Then the cropping rectangle is created and is 1800 pixels wide by 1300 pixels tall.

Illustration of the crop area created by adding cropping parameters that fall within the image

Now we perform the live conversion for the image using crop=dim:[2000,900,1800,1300]:

Result:

the original image cropped to the specified dimensions using Filestack image transformation

Original Image

the original photo to be cropped

Illustration of the crop area created by adding the crop parameters crop=dim:[1500,2000,3800,1600].

The crop area starts 1500 pixels in and 2000 pixels down while the cropping rectangle is 3800 pixels wide by 1600 pixels tall.
A portion of the cropping area exists outside of the image.

example where the crop parameters to be applied extend outside of the image

Now we perform the live conversion for the image using crop=dim:[1500,2000,3800,1600]:

Result:

the result of the crop performed using Filestack's transformations

Original Image

the original photo to be transformed

Illustration of the crop area created by adding the crop parameters crop=dim:[0,0,1000,1300].

The crop area starts 0 pixels in and 0 pixels down (the top left hand corner of the image), while the cropping rectangle is 1000 pixels wide by 1300 pixels tall.
A portion of the cropping area exists outside of the image.

illustration of the cropping area created by the crop parameters being used

Now we perform the live conversion for the image using crop=dim:[0,0,1000,1300]:

Result:

the original image cropped to the dimensions specified by the crop parameters