# scaleimagetofit: Scale an Image to Fit Given Dimensions

> scaleimagetofit (Scale an Image to Fit Given Dimensions) is a 1001fx API function in the group Images: POST https://api.1001fx.com/images/scaleimagetofit, 3 credits per call. It works as a ready-made module in Make and n8n or as a plain HTTP call.

Scales an image to the largest size that will fit within a rectangle of the specified width and height.

- Group: Images
- Endpoint: `POST https://api.1001fx.com/images/scaleimagetofit`
- 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/scaleimagetofit

## Parameters

- `width` (number, required, min 1, max 10000) – Width: The width to scale the image to.
- `height` (number, required, min 1, max 10000) – Height: The height to scale the image to.
- `file` (file, required) – Image file: Image file to be processed.

## Example: Image scale to fit 1200x1000

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