---
title: Crop Image to Desired Size API
slug: crop-image-to-desired-size-api
url: https://apyhub.com/freedailypro/service/crop-image-to-desired-size-api
provider: FreeDailyPro
auth: api_key
version: 1.0.0
service_type: sync
endpoints: 1
atoms: 10
mcp: true
---

# Crop Image to Desired Size API

Crop PNG and JPEG images to specific dimensions using the FreeDailyPro API. Define custom crop coordinates to prepare photos, product images, thumbnails, and screenshots.

## Endpoints

| Method | URL | Description | Atoms |
| --- | --- | --- | --- |
| POST | `https://api.eu.apyhub.com/freedailypro/crop-image-to-desired-size-api/image-crop` | What it does Crops an uploaded image to a rectangular region and returns the cropped image as binar… | 10 |

## Endpoint reference

### Crop an image

`POST https://api.eu.apyhub.com/freedailypro/crop-image-to-desired-size-api/image-crop` · 10 atoms · accepts `multipart/form-data` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `h` | body | number | yes | Height of the crop area (0–1, relative to image height). |
| `w` | body | number | yes | Width of the crop area (0–1, relative to image width). |
| `x` | body | number | yes | Horizontal starting position of the crop (0–1, relative to image width). |
| `y` | body | number | yes | Vertical starting position of the crop (0–1, relative to image height). |
| `file` | body | string (binary) | yes | The image. Up to 15 MB. |
| `format` | body | string | no | png or jpeg |

#### Quickstart

Crop an uploaded image by sending the file and the crop region as fractions (0–1) of the image size.

```bash
curl -X POST "https://api.eu.apyhub.com/freedailypro/crop-image-to-desired-size-api/image-crop" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/image.jpg" \
  -F "x=0.1" \
  -F "y=0.1" \
  -F "w=0.5" \
  -F "h=0.5"
```

#### What you'll get back

Returns the cropped image as binary data (a file download), not a JSON object. The example above crops the area starting 10% from the left and top edges and covering 50% of the width and height.

## About

## What it does
Image Cropper lets you crop an image by sending the source file and crop bounds, then returns the cropped image as binary output. Use it when you need to trim user-uploaded photos, isolate a product shot, or generate fixed image regions for downstream processing.

POST `/image-crop` with an image file up to 15 MB and the crop rectangle defined by `x`, `y`, `w`, and `h` in pixels. You can also specify `format` as `png` or `jpeg` to control the output image type. The service does not return metadata or a JSON wrapper; it returns the cropped image directly.

This is a good fit for image pipelines where you already know the target region, such as avatar creation, thumbnail preparation, document image cleanup, or extracting a specific area from a screenshot. The API keeps the interaction simple: define the crop area, send the file, and use the returned image wherever your app needs it.

## Usage

Base URL: `https://api.eu.apyhub.com` (default region — see
`GET https://apyhub.com/api/public/regions` for the rest).

Authenticate with an ApyHub API key in the `apy-token` header.
Full docs and a live playground: https://apyhub.com/freedailypro/service/crop-image-to-desired-size-api
