Perceptual Image Compressor
Compress images to a quality score you choose, with real size and SSIMULACRA2 (MS-SSIM fallback) measurements, error heatmaps and a paint-to-preserve brush
Loading Perceptual Image Compressor...
What this image compressor does
The Perceptual Image Compressor shrinks JPEG, PNG, WebP and AVIF images to the smallest file that still reaches a quality score you choose. Everything runs locally in your browser, so your images are never uploaded. After each run it shows the real before and after sizes, the measured score and which metric produced it (SSIMULACRA2 or the MS-SSIM fallback), the time it took, the route and the engines that ran.
For a plain quality slider with format preservation, use the Image Compressor. To convert to WebP, try the Image to WebP converter. More tools are in the Image Tools category.
How to Use
- Choose an output format, or leave Auto, and set the perceptual target. Higher keeps more detail.
- Drop in one or many images. Each shows Pending, Processing or Done in the queue.
- Select a file to compare it with the original using the split divider (arrow keys also work).
- Switch to the error heatmap to see where the compressed image differs most.
- Brush over areas such as faces or small text to exempt them from the pre-filter smoothing (and to weight them in the PNG palette), and let it re-run. The codec still compresses them.
- Download one file, all files as a ZIP, or export a responsive picture bundle.
How it Works
1. Classify
Counts colors, edges and noise. Flat graphics go to a palette PNG quantized with imagequant and optimised with oxipng. Photos go to MozJPEG, WebP or AVIF.
2. Pre-filter
Smooths noise and fine detail that fall below a just-noticeable-difference threshold, away from salient areas and regions you painted.
3. Search
Tries encoder qualities on a few representative tiles, then confirms on the full image. Each try is a real encode, decode and score.
4. Verify
Reports the measured score and size. If nothing beats the original file, the original is kept and the result says so.
The score is SSIMULACRA2 (0-100, where about 90 is visually lossless, 70 high and 50 medium) computed by a Rust crate compiled to WebAssembly. It is used for images up to 4 megapixels because it takes seconds per megapixel (about 4 s for 1080p on one thread, about 1.8 s with 4 threads). If the crate cannot load, or the image is larger, the tool falls back to its own MS-SSIM score (multi-scale SSIM on luminance plus a chroma term, spread over 0-100 and not comparable with SSIMULACRA2) for the whole run, and the result says which metric ran. Either way it is a proxy for similarity, so check the comparison view for images that matter.
Local compression vs server tools
| Aspect | This tool | Typical server tool such as TinyPNG |
|---|---|---|
| Where files go | Stay in your browser | Uploaded to a server for processing |
| Quality control | You set a measured score target | Usually a fixed, tool-chosen quality |
| Speed on large files | Limited by your device, AVIF is slow | Limited by upload speed and server load |
| Encoders | MozJPEG, WebP, AVIF, imagequant and oxipng compiled to WebAssembly | Varies by service |
Server tools can be faster on weak devices and offer API access. Pick this tool when privacy or a target quality matters more than raw speed.
Limitations
- • ICC color profiles and animation are not preserved. GIF input is compressed as a still image.
- • Searching, scoring and encoding always run on the CPU in WebAssembly, in a worker pool that also evaluates several quality candidates in parallel. Where the page is cross-origin isolated (Chromium browsers; Firefox 119+ should also qualify but has not been tested here) SSIMULACRA2 and palette quantization use threaded WebAssembly; Safari and any non-isolated context use the single-threaded build, with the same results.
- • WebGPU is used only to draw the error heat map. It never changes the chosen quality, the file or the score, and without a GPU adapter the heat map is computed on the CPU. WebNN and WebCodecs ImageDecoder are detected but not used.
- • ML saliency (U-2-Netp, about 17 MB first download) is optional and off by default. It runs on WebAssembly, not on the GPU, and falls back to the built-in saliency if it cannot load.
- • JPEG output uses MozJPEG, not Jpegli. JPEG XL output is not offered.
- • SSIMULACRA2 takes seconds per megapixel even when threaded; above 4 megapixels the MS-SSIM fallback score is used instead of SSIMULACRA2.
- • Very large images use a lot of memory: they run one at a time, and a file too large for your device's memory is refused with a message suggesting a smaller maximum dimension.
Privacy & Security
100% Private: images are decoded, compressed and scored in background workers on your device. Nothing is uploaded, which makes it suitable for confidential or personal photos. Re-encoding also removes EXIF and GPS data from the output.