---
title: "Resize and convert a picture"
method: POST
path: "/v1/image/convert"
tags: ["Image tools"]
---

# Resize and convert a picture

`POST /v1/image/convert`

## Request

- Base URL: `https://api.dharun.dev`
- URL: `https://api.dharun.dev/v1/image/convert`
- Auth: none declared

Returns the picture itself, turned upright from its EXIF orientation, without metadata. fit=inside keeps the whole picture within width and height and never enlarges it; cover fills the box and crops the middle; fill stretches. Options go in the query string, or as form fields when the file is sent as multipart/form-data.

## Query parameters

- `format` 'jpeg' | 'png' | 'webp' | 'avif' | 'gif' | 'tiff'
- `width` integer
- `height` integer
- `fit` 'inside' | 'cover' | 'fill'
- `quality` integer

## Response `200`

Success

## Other responses

- `400`: Error
- `404`: Error
- `413`: Error
- `429`: Error

---

[API](https://skmtc.dev/dharun/apis/india-api-free-open-source-apis-for-indian-data.md) · [All operations](https://skmtc.dev/dharun/apis/india-api-free-open-source-apis-for-indian-data/llms.txt) · [OpenAPI document](https://skmtc.dev/dharun/apis/india-api-free-open-source-apis-for-indian-data/revisions/ecd8b0ec7863?raw)
