---
title: "Resize an image"
method: POST
path: "/image/resize"
tags: ["Image"]
---

# Resize an image

`POST /image/resize`

## Request

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

Resize an image to width and/or height with a fit mode (cover, contain, fill, inside, outside). Returns the image bytes (default) or JSON with base64.

## 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)
  - `width` integer
  - `height` integer
  - `fit` 'cover' | 'contain' | 'fill' | 'inside' | 'outside'

## 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)
