---
title: Compress Images API
slug: compress-images
url: https://apyhub.com/apyhub/service/compress-images
provider: ApyHub
categories: [File Conversion, File Manipulation]
auth: api_key
---

# Compress Images API

Compress JPEG, PNG, WebP, GIF, TIFF, and BMP images from a URL or upload. Get a smaller file or a signed download link.

## Endpoints

| Method | Path | Description | Atoms |
| --- | --- | --- | --- |
| POST | `/processor/image/compress/url/file` | What it does Compresses an image fetched from a public URL and returns the compressed file as binar… | 30 |
| POST | `/processor/image/compress/file-urls` | What it does Compresses an image fetched from a publicly accessible URL and returns a time-limited… | 30 |
| POST | `/processor/image/compress/file` | What it does Compresses an uploaded raster image and returns the compressed file as a binary downlo… | 30 |
| POST | `/processor/image/compress/file/url` | What it does Compresses a raster image uploaded as multipart form data and returns a time-limited s… | 30 |

## About

## What it does
Image Compressor reduces the size of raster image files while letting you control the compression level and output handling. Send a public image URL or upload an image file, and choose a `compression_percentage` from 1 to 100. You can also set `preserve_format` and an `output` name for the generated file.

Use the URL endpoints when your source image already lives on the web, or the multipart endpoints when you want to upload a local file. Supported formats include JPEG, PNG, WebP, GIF, TIFF, and BMP. The service returns either the compressed file itself or a time-limited signed URL to the stored result, depending on the endpoint you call.

This is useful when you need to cut image transfer costs, reduce storage usage, or generate lighter assets for web and mobile delivery. For example, you can compress product photos before serving them through a frontend, or shrink uploaded images before saving them to object storage.

If you need the file immediately, use the download endpoints. If you need a link you can pass to another system, use the signed-URL endpoints.

## Usage

Authenticate with an ApyHub API key in the `apy-token` header.
Full docs and a live playground: https://apyhub.com/apyhub/service/compress-images
