Skip to main content

Compress Image

ImageCompress Image

The Compress Image API reduces image file size while keeping acceptable quality. You send the image as Base64 (docContent), docName, and optionally imageType (JPG, PNG), compressionLevel (Max, Medium, Low), and async. The API returns the compressed image. Use the tester below to try it; more details are in the sections that follow.

Try the Compress Image API

Quick reference

Endpoint: POST /api/v2/CompressImage · Required: api-key, docContent, docName

Try it live

Use the form below to send your API key and image (Base64). Choose output format and compression level; the response is the compressed image. No code required—fill the fields and click Send request.

Loading API Tester...

Overview, parameters, and use cases

What is Compress Image?

This endpoint compresses an image to reduce file size. You provide the image (Base64), docName, and optionally imageType (JPG or PNG) and compressionLevel (Max, Medium, Low). The API returns a smaller file while preserving usable quality. Use async for large images.

Key features

  • Format – Output as JPG or PNG via imageType.
  • Compression levelMax, Medium, or Low to balance size vs. quality.
  • Async – Use async for large images to avoid timeouts.
Best for

Use when you need smaller images for web, email, or storage. Combine with Resize Image or Convert Image Format in a pipeline.

Prerequisites

Before using this endpoint, make sure you have:

  • A valid PDF4me API key (Get your API Key)
  • An image file (JPG, PNG) in Base64 format

Response Format

The API returns a compressed image file with the specified format and compression level.

Get Help