# cropimage: Crop an Image by x, y, Width and Height

> cropimage (Crop an Image by x, y, Width and Height) is a 1001fx API function in the group Images: POST https://api.1001fx.com/images/cropimage, 3 credits per call. It works as a ready-made module in Make and n8n or as a plain HTTP call.

Crops an image to the region given by x, y, width and height. Without values it starts at 0, 0 and keeps the full width and height.

- Group: Images
- Endpoint: `POST https://api.1001fx.com/images/cropimage`
- Authentication: header `X-API-KEY: YOURSECRETAPIKEY`
- Content type: multipart/form-data
- Credits: 3 credits per call
- Ready-made in: Make and n8n
- Docs: https://1001fx.com/functions/cropimage

## Parameters

- `x` (number, optional, default `0`) – X coordinate: The x coordinate to crop from. Defaults to 0.
- `y` (number, optional, default `0`) – Y coordinate: The y coordinate to crop from. Defaults to 0.
- `width` (number, optional) – Crop width: The width of the crop region. Defaults to the images width.
- `height` (number, optional) – Crop height: The height of the crop region. Defaults to the images height.
- `file` (file, required) – Image file: Image file to be processed.

## Example: Image crop

```bash
curl -X POST 'https://api.1001fx.com/images/cropimage' \
  -H 'X-API-KEY: YOURSECRETAPIKEY' \
  -F 'file=@1600x900.png' \
  -F 'x=200' \
  -F 'y=200' \
  -F 'width=200' \
  -F 'height=200'
```
