Compress Image
Compression Options Documentation
Supported Formats and Their Options
PNG (.png)
-
compressionLevel: 0 (no compression) to 9 (maximum compression).
-
adaptiveFiltering: Use adaptive filtering (true/false).
-
palette: Use palette-based color reduction (true/false).
-
quality: 0 to 100 (if palette is true).
-
effort: 0 (fastest) to 10 (slowest).
JPEG (.jpg, .jpeg)
-
quality: 0 to 100.
-
progressive: Create a progressive JPEG (true/false).
-
chromaSubsampling: ‘4:4:4’, ‘4:2:2’, or ‘4:2:0’.
-
trellisQuantisation: Use trellis quantization (true/false).
-
overshootDeringing: Use overshoot deringing (true/false).
-
optimizeScans: Optimize scans for progressive JPEG (true/false).
-
mozjpeg: Use MozJPEG for compression (true/false).
WebP (.webp)
-
quality: 0 to 100.
-
alphaQuality: 0 to 100.
-
lossless: Use lossless compression (true/false).
-
nearLossless: Use near-lossless compression (true/false).
-
smartSubsample: Use smart subsampling (true/false).
-
effort: 0 (fastest) to 10 (slowest).
TIFF (.tiff, .tif)
-
quality: 0 to 100.
-
compression: ‘lzw’, ‘deflate’, or ‘jpeg’.
-
predictor: ‘none’, ‘horizontal’, or ‘float’.
-
tile: Use tiling (true/false).
-
tileWidth: Tile width (if tile is true).
-
tileHeight: Tile height (if tile is true).
-
pyramid: Create a multi-resolution pyramid image (true/false).
-
bitdepth: 8 or 16.
GIF (.gif)
-
reoptimise: Re-optimize the GIF (true/false).
-
effort: 0 (fastest) to 10 (slowest).
AVIF (.avif)
-
quality: 0 to 100.
-
lossless: Use lossless compression (true/false).
-
speed: 0 (slowest) to 10 (fastest).
-
chromaSubsampling: ‘4:4:4’, ‘4:2:2’, or ‘4:2:0’.
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Query Parameters
Body
Response
The response is of type object
.