Image

Lossless Image Compression

0calls
2 credits / call

Still worried about image size and loading speed? Experience our powerful lossless compression service, which can compress image size to the extreme while hardly sacrificing any visually perceptible image quality.

Overview

You just need to upload a common image (such as PNG, JPG), select a compression level, and you will get a surprisingly small compressed file. This is a powerful tool for optimizing user experience, saving bandwidth and storage costs for websites, Apps or mini-programs that need to display a large number of high-definition images.

Usage Notes

Tip

The larger the image or the higher the compression level, the longer the processing time may be, please wait patiently.

Warning

Processing Time Reminder When traffic is high, processing time may be further extended. If your business is sensitive to return time, it is recommended to reserve sufficient processing time.

Request and Response Format

  • Requests must use multipart/form-data format to upload files.
  • Successful responses will directly return the compressed file binary stream (image/*), with Content-Disposition header attached, it is recommended that clients save files based on this header information.

Parameter Details

level (Compression Level)

This is an integer from 1 to 5, which determines the intensity and strategy of compression. The smaller the number, the higher the compression rate. All levels are carefully tuned to maximize compression rate while ensuring excellent visual quality.

  • 1: Extreme Compression (Recommended, smallest size, excellent quality)
  • 2: Efficient Compression
  • 3: Smart Balance (Default option)
  • 4: Quality First
  • 5: Professional Fidelity (Slightly lower compression rate, retains most image information)

Error Handling Guide

  • 400 Bad Request: Usually because no file was uploaded, or the level parameter is not in the range of 1-5.
  • 500 Internal Server Error: If an internal server error occurs during the compression process, this status code will be returned.

Query parameters

level
integeroptional

Compression intensity (1-5), default is 3. The smaller the number, the higher the compression rate.

format
stringoptional

Output image format, can be 'png' or 'jpeg'.

Request body

file
filerequired

Supports common image formats such as PNG, JPG, JPEG, etc. File size not exceeding 15MB.

Response

200 / OK

Compression successful response. Response is compressed image binary data. Return format will change based on your selected target format, default is PNG image data.

image/*

400 / Bad Request

Invalid request. May be due to no file uploaded, unsupported file format or parameter error.

JSON

500 / Internal Server Error

Internal server error. An error occurred during compression.

JSON