A darkroom for the weight of a photo

Pikkola, tool No. 21

The picture is the point. Everything else in the file is overhead, and most of it can go.

What a phone photo carries

A 12 megapixel photo is about 36 megabytes of raw sensor data before the camera decides what to keep. The JPEG it hands you is around four. Inside that file are the pixels at a quality setting the camera chose, a thumbnail, a colour profile, a block of EXIF with the time, the coordinates, the device and the software, and sometimes a second, smaller preview for messaging apps.

On a blog post or a landing page, only the pixels are doing work. The rest is weight, and in the EXIF case it is also a privacy problem: a photo of your kitchen can carry the latitude and longitude of your kitchen.

What re-encoding does

The browser decodes the file into a canvas, which is a grid of pixels in memory. Drawing it at a smaller size throws away detail on purpose. Encoding that canvas again with toBlob writes a brand new file containing the pixels and nothing else. The EXIF block does not survive, because nothing in the encoder knew it existed.

Quality is a dial on how much the encoder is allowed to approximate. At 78 most photos look the same on a screen at normal size. The difference lives in fine grain, in a smooth sky, and around sharp text, which is exactly where the comparison slider is pointed.

Why the slider

A percentage saving is easy to read and easy to misread. A file can drop 90 percent and look terrible, or drop 40 and look identical. The split view puts the real output beside the real input at the same display size, so the judgement is yours and not a number's.

What this page will not do

Who runs it

Pikkola Lab builds small browser tools, one instrument at a time. This is the twenty first: an image bench that stays on your machine. Questions, complaints and requests go to [email protected].