Image Compressor
Shrink JPG, PNG, WebP without losing visible quality.
Written by Anil Gautam · Updated
What does the quality slider change for JPG, PNG and WebP?
Each file keeps its format. For JPG and WebP the slider value goes to the browser's own encoder, so 70 means quality 0.70, and lower values discard fine detail first. PNG has no quality setting, so the compressor reduces the number of colors instead, allowing at most 4,096 colors multiplied by the slider percentage. At 70% a PNG keeps no more than 2,868 colors, at 10% about 410, and even 100% caps it at 4,096. Screenshots and logos with a few hundred colors usually come through with their colors intact, while photographic PNGs can show banding in smooth gradients.
Pixel dimensions normally stay the same. The library only shrinks them when an output would be over 10 MB, and on an iPhone, where it limits the canvas area to 16,777,216 pixels (4096 × 4096): a 48-megapixel 8064 × 6048 photo comes back as 4592 × 3444. EXIF data is not copied. The photo is drawn upright before saving, so rotation still looks right, but the capture date, camera details and GPS location are gone.
Why is a compressed file sometimes bigger than the original?
After the first pass, the library checks whether the result is smaller than your original and under 10 MB (10,485,760 bytes). If it is, you get that file. Otherwise it tries again up to 10 more times, multiplying the quality by 0.95 each round for JPG and WebP or by 0.85 for PNG, and cutting width and height by 5% per round only when the 10 MB limit is the problem. Starting from 70, ten rounds take a JPG down to about quality 42.
If the file is still not smaller after the last round, that attempt is returned anyway. This can happen with JPGs already saved at low quality and with PNGs that were optimized before. Compare the two sizes on each card, and keep your original when the new one is not smaller. A card that shows no new size after compressing means that file failed, and it is left out of the ZIP. Downloads are named compressed- plus the original name, and more than one file comes as compressed-images.zip.
Which files need a different tool?
BMP files come back as uncompressed 32-bit BMPs. For a 1920 × 1080 image that is 8,294,522 bytes, a third more than the usual 24-bit original, so use BMP to JPG or BMP to PNG for those. An upload form with a hard limit is better served by Compress Image to 200KB, which works toward a size you type in KB. When a photo is far larger than it will be displayed, Bulk Image Resizer often saves more than any quality setting: a photo 4000 pixels wide shown at 1200 pixels carries about eleven times the pixels it needs.