---
title: "Crop a region of an image"
method: POST
path: "/image/crop"
tags: ["Image"]
---

# Crop a region of an image

`POST /image/crop`

## Request

- Base URL: `https://abundanceapis.com`
- URL: `https://abundanceapis.com/image/crop`
- Auth: none declared

Extract a rectangular region (left, top, width, height) from the image.

## Request body

- object
  - `url` string: Public image URL
  - `base64` string: Base64-encoded image (data URI ok)
  - `output` 'binary' | 'base64': Return the image bytes or JSON with base64
  - `format` 'jpeg' | 'png' | 'webp' | 'avif': Output format (default: keep input)
  - `quality` integer: Output quality (lossy formats)
  - `left` integer, required
  - `top` integer, required
  - `width` integer, required
  - `height` integer, required

## Other responses

- `400`: Bad request
- `502`: Could not load the image

---

[API](https://skmtc.dev/abundanceapis/apis/web-toolbox.md) · [All operations](https://skmtc.dev/abundanceapis/apis/web-toolbox/llms.txt) · [OpenAPI document](https://skmtc.dev/abundanceapis/apis/web-toolbox/revisions/ada2893fef43?raw)
