Image Compression Microscope
Image Compression Microscope performs a real browser encode-and-decode round trip, then compares the returned pixels with the source. It separates those measurements from declared mechanism models for JPEG transform quantization, PNG row filters, and the two different codec families behind WebP.
Switch from JPEG to PNG and watch the difference map and hidden bits change.
The picture can survive while the payload dies
Each square is one least-significant bit written before compression and read from the same channel after decoding. A crossed square changed.
8 × 8 transform blocks → quantization → entropy coding
The block view reproduces the transform and a conventional luminance table. It does not expose this browser encoder's private tables or chroma decisions.
8 × 8 luma samples
Transform coefficients
After quantization
61/64 coefficients became zero at quality 72.
What it does
- Encode a generated sample or a local image as JPEG, PNG, or WebP without uploading it.
- Compare source, decoded output, an amplified difference map, file size, mean channel error, and peak signal-to-noise ratio.
- Write a deterministic payload into RGB least-significant bits and measure how many bits survive the actual round trip.
- Inspect declared mechanism models for JPEG 8 × 8 transform quantization and the five reversible PNG row filters.
- Read the returned WebP container to distinguish a VP8 lossy stream from a VP8L lossless stream when the browser exposes one.
How to use Image Compression Microscope
-
Choose a codec
Switch between JPEG, PNG, and WebP. JPEG and WebP expose the quality target accepted by the browser API.
-
Run the real round trip
The browser writes payload bits, encodes the pixels, decodes the returned file, and measures the reconstructed samples.
-
Inspect the failure
Use the error map and hidden-bit grid to separate visual similarity from exact data survival.
-
Open the mechanism model
Trace one 8 × 8 JPEG block, compare PNG predictors, or distinguish WebP's lossy and lossless codec families.
Formats and limits
Inputs
- The generated test image or one local PNG, JPEG, or WebP file.
- A requested JPEG or WebP quality value from 15 to 98.
Outputs
- A decoded image produced by the browser codec.
- File size and pixel-error measurements.
- A measured hidden-bit survival map.
- A declared educational model of the selected codec mechanism.
Compatibility
- PNG and JPEG canvas encoding are widely available in current browsers.
- WebP encoding can be unavailable or can choose a browser-specific mode; the tool reports the returned container instead of assuming it.
- Uploaded images are scaled to at most 640 pixels on the longest side for responsive local analysis.
Known limits
- Canvas exposes a quality target, not the encoder's quantization tables, chroma-subsampling decision, search strategy, or entropy model.
- The JPEG and PNG mechanism panels are calculated explanatory models, not internal telemetry from the returned file.
- Peak signal-to-noise ratio measures numeric error and is not a complete perceptual-quality metric.
- The hidden-bit experiment tests sequential spatial RGB least-significant bits; it does not represent every steganographic or watermarking method.
Where your data goes
- The selected image, encoding, decoding, and measurement remain in the current browser tab.
- The tool does not upload images or retain the generated compressed file.
Why visual similarity and data integrity are different measurements
Before encoding, the tool writes 768 deterministic bits into the least-significant bits of red, green, and blue samples. It sends the resulting pixel array through the browser's canvas encoder, decodes the returned image, and compares the two arrays channel by channel. PNG normally returns the same values, while lossy JPEG or WebP can change many samples even when the image looks stable. The mechanism panels are kept separate: JPEG applies a two-dimensional discrete cosine transform to an 8 × 8 luminance block and divides coefficients by a quality-scaled quantization table; PNG computes the five standard reversible row-filter residuals; WebP is identified as a container for either lossy VP8 intra coding or its separate VP8L lossless format.
Questions about Image Compression Microscope
Does the tool use the real image codecs?
Yes for the encode-and-decode result. The browser produces the file and decodes it again. The mechanism panels are declared models because the browser does not expose its internal encoder decisions.
Why can a JPEG look unchanged while hidden data is damaged?
Human vision tolerates many small color errors. A payload stored in exact bit positions does not: one changed least-significant bit changes the recovered message.
Is PNG always smaller than the original pixels?
No. PNG is lossless, but its filters and DEFLATE stage only reduce size when the pixel data contain exploitable structure. Small or noisy images can gain little after container overhead.
Is WebP one compression algorithm?
No. WebP can carry a lossy VP8 intra-frame stream or a separate lossless VP8L stream with reversible transforms, LZ77 references, a color cache, and prefix codes.