SquishPixel / How it works
How it works
The compressor is delivered to your browser. Your images are never delivered to us.
Where the work happens
Most online compressors upload your file, process it on their servers and send the result back. SquishPixel does the opposite. When you open the page, your browser downloads the same kind of image encoders those servers use, compiled to WebAssembly. Each image you drop is read, compressed and saved on your own device.
The page is also sent with a browser rule, a Content Security Policy, that only allows it to talk tosquishpixel.com. Even if the code tried to send your image somewhere else, the browser would block it.
What happens to each image
- Identify. The first bytes of the file tell us what it really is, whatever its name says.
- Decode. The image is unpacked into raw pixels. Rotation stored by a camera is applied here.
- Encode. The pixels are written out again with a modern encoder at the quality you chose.
- Check. If the result is not smaller than your original and the format has not changed, you get the original back untouched.
This runs in background threads, several images at a time, so the page stays responsive while a large batch is in progress.
The encoders
- JPEG: MozJPEG, saved as progressive JPEG.
- PNG: a palette of up to 256 colours with dithering, then OxiPNG. The Sharper setting skips the palette and changes no pixels.
- WebP: libwebp.
- AVIF: libavif with the AV1 encoder.
- JPEG XL: libjxl.
- GIF: the animation is rebuilt with one shared palette, and each frame stores only the pixels that changed. Timing and looping are kept.
- Animated PNG and WebP: re-encoded frame by frame, and they stay animated.
- SVG: cleaned with SVGO, which removes editor leftovers and shortens paths. Pick a pixel format and the SVG is drawn instead.
- HEIC: iPhone photos are opened with libheif and saved as JPEG, or as whichever format you pick. HEIC itself cannot be written.
The quality settings
Smaller, Balanced and Sharper set the encoder quality. For JPEG and WebP they are 60,75 and 88 on the usual 0 to 100 scale. AVIF uses its own scale, where lower numbers still look good: 38, 50 and 65.
What is removed
Only the picture is kept. Camera model, capture time, GPS position and embedded colour profiles are not copied to the squished file. Colours are converted to standard sRGB, which is what web browsers expect.
Limits
Animations are always saved in their own format, so an animated GIF stays a GIF. Animated AVIF is not handled yet. Very large images and long animations depend on your device's memory: a phone may refuse a file a laptop handles easily.