Image Compressor – Compress JPG, PNG & WebP to Target KB
Pricing
from $0.80 / 1,000 image compresseds
Image Compressor – Compress JPG, PNG & WebP to Target KB
Compress images in bulk without visible quality loss: optimised JPG, palette PNG, WebP or AVIF, or squeeze each file under a target size in KB. Strips metadata, keeps the original when it is already smaller, and reports savings per image. Bulk URLs or a dataset. $0.80 per 1,000.
Pricing
from $0.80 / 1,000 image compresseds
Rating
0.0
(0)
Developer
Cemal Atakli
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
6 days ago
Last modified
Categories
Features
Share
Image Compressor – Compress JPG, PNG & WebP Images in Bulk (to a Target KB)
Compress hundreds or thousands of images from a list of URLs or an Apify dataset. Each file keeps its own format by default (JPG stays JPG, PNG stays PNG). The Actor picks the lowest quality that still looks the same (an SSIM check), can squeeze every file under a target size in KB, strips EXIF/GPS metadata, and never returns a file that is larger than the original. You get a download link and a savings report for every image.
$0.80 per 1,000 compressed images. Images that could not be made smaller are returned unchanged and are free.
What it does
- Visually lossless "auto" quality. For JPG, WebP and AVIF it searches quality 60–90 and keeps the lowest setting whose SSIM stays at or above 0.98 (you can choose 0.95–0.995). SSIM is measured on a 512 px crop at full resolution, so artefacts are not hidden by downscaling.
- Target file size. Set
targetKb(for example 100 for upload forms that require "under 100 KB"). Quality is lowered first, then PNGs switch to a palette, and as a last step the dimensions are reduced. Each row hastargetMet. - Max width/height.
maxDimensiondownscales large photos (for example 2000 px for a web shop) before compression. It runs before the target size. - PNG palette compression (like TinyPNG). In
automode a PNG is reduced to 256 colours only when SSIM stays above the threshold, so logos, icons and screenshots shrink by 60–90% while photos and gradients stay full-colour. - Never larger. With
keepOriginalIfSmaller(on by default) an image that would not shrink by at leastminSavingsPercent(2%) is returned unchanged and not charged. - Metadata stripped (EXIF, GPS, camera data) for privacy and smaller files. The colour profile is kept, and EXIF orientation is applied to the pixels so phone photos are not sideways.
- Savings report:
originalKb,compressedKb,savedKb,savedPercent,quality,ssimper image, plus aSUMMARYrecord with the run total. - Optional format change: WebP, AVIF, JPG or PNG. HEIC/HEIF inputs become JPG.
Use cases
- Core Web Vitals / page speed: compress every image of a site before upload and see how many KB you saved.
- E-commerce catalogues: shrink supplier product photos to a max size and a target KB before importing them into Shopify, WooCommerce or a PIM.
- Scraper pipelines: chain after an image scraper or our Image Downloader with
datasetId, and store the compressed files in Apify storage. - Upload limits: get every file under 100 KB, 200 KB or 1 MB for forms, marketplaces or email.
Input example
{"imageUrls": ["https://raw.githubusercontent.com/xinntao/Real-ESRGAN/master/inputs/children-alpha.png","https://raw.githubusercontent.com/ianare/exif-samples/master/jpg/gps/DSCN0010.jpg"],"outputFormat": "same","quality": "auto","targetKb": 0,"maxDimension": 0}
Other sources: bulkText (one URL per line or a CSV with a url column), sourceFileUrl (a public .txt/.csv, e.g. a Google Sheet published as CSV) and datasetId + datasetField (any Apify dataset you can read).
Output example
{"sourceUrl": "https://raw.githubusercontent.com/ianare/exif-samples/master/jpg/gps/DSCN0010.jpg","status": "compressed","imageUrl": "https://api.apify.com/v2/key-value-stores/<storeId>/records/00002-DSCN0010-1a2b3c.jpg","format": "jpg","width": 640,"height": 480,"originalKb": 161.7,"compressedKb": 123.2,"savedKb": 38.5,"savedPercent": 23.8,"quality": 79,"ssim": 0.9803,"keptOriginal": false,"metadataStripped": true}
status is compressed (charged), kept-original (free; the unchanged file is still stored), not-smaller (free; only when you turn keepOriginalIfSmaller off) or error (free, with errorCode). The SUMMARY record in the key-value store has images, compressed, keptOriginal, failed, totalOriginalKb, totalCompressedKb, totalSavedKb, overallSavedPercent and avgSavedPercent. 1 KB = 1,000 bytes.
Pricing
| Event | Price |
|---|---|
| Image compressed (output smaller than the original) | $0.0008 ($0.80 per 1,000) |
| Actor start | $0.00005 |
Free: images kept unchanged, failed downloads, non-images, invalid URLs and duplicates. If you set a maximum total charge, the run stops cleanly when it is reached and SUMMARY.stoppedAtMaxCharge is true.
| Actor (Apify Store, Nov 2026) | Price per image |
|---|---|
| This Actor | $0.0008, unchanged files free |
| marielise.dev/image-converter | $0.002 (files ≤ 500 KB) |
| conserving_celerytop/image-converter-compressor | $0.003 |
| ntriqpro/image-batch-optimizer | $0.01 |
Limits (honest)
- Inputs must be public direct image links. Pages that block datacenter IPs may need the optional proxy.
- Animated GIF, WebP and PNG files are returned unchanged (free); only static images are recompressed.
- SSIM is a good but not perfect measure of "looks the same". It is checked on the central 512 × 512 px area. Use 0.99 for very safe results or 0.95 for smaller files.
- Files that were already compressed well (for example by TinyPNG or a CDN) often cannot shrink further; they are returned unchanged for free.
- A strict
targetKbtakes priority over quality: very small targets give visible artefacts or smaller dimensions (resized: true,ssimempty). - No AI upscaling, background removal or format-specific tricks such as JPEG XL or MozJPEG.
FAQ
Does it change the format? Not by default. Choose WebP or AVIF in outputFormat for the smallest files; for a full converter with resize modes see our Bulk Image Converter.
Is it lossless? PNG output without a palette is lossless. JPG, WebP and AVIF are lossy but tuned to stay visually identical (SSIM ≥ 0.98 by default).
Where are the files? In the run's key-value store. imageUrl is a direct download link; the Storage tab lists all files.
Why was I not charged for some images? They could not be made at least 2% smaller, so the original was returned. You only pay for real savings.
Use with AI agents (Apify MCP)
Add this Actor to an MCP client through the Apify MCP server (https://mcp.apify.com, tool gazidev/image-compressor). An agent can pass a list of image URLs with targetKb or maxDimension and read imageUrl, savedPercent and the SUMMARY record from the result.