Lossless Image Compression
Lossless Image Compression
POST /image/compress - Lossless Image Compression
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.