About this endpoint
What it does
Crops an uploaded image to a rectangular region and returns the cropped image as binary data. The region is given as fractions of the image size, so the same values work for any resolution.
Request Body
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| file | String | Yes | The image file to crop. Binary upload. Up to 15 MB. |
| x | Number | Yes | Horizontal starting position of the crop (0–1, relative to image width). |
| y | Number | Yes | Vertical starting position of the crop (0–1, relative to image height). |
| w | Number | Yes | Width of the crop area (0–1, relative to image width). |
| h | Number | Yes | Height of the crop area (0–1, relative to image height). |
| format | String | No | Output image format: png or jpeg. |
Example: x = 0.1, y = 0.1, w = 0.5, h = 0.5 defines a crop area starting 10% from the left and top edges, covering 50% of the image's width and height.
Response
Returns a binary file containing the cropped image. The response body is a single binary string, not a JSON object.


