CompressPhotosCompress photos

About CompressPhotos

CompressPhotos makes photos smaller on the device you are using. One photo for a form, twenty for an email, or four thousand from a phone backup — the same desk, the same recipe, and a receipt for every file.

What happens to a photo

You choose photos or a folder and declare one recipe: a quality with its encoder number printed beside it, a size per file (a ceiling, an exact KB target or a range, or one total for the whole set), the pixel size (a long edge, a percent, an exact width × height or a megapixel cap), a format, and a choice about capture information. A form preset sets the size range, pixels and DPI from a dated source and checks every output against them; a lossless mode rewrites JPEG and PNG without re-encoding a pixel. Your browser then decodes and re-encodes each photo in a background worker, and every file gets a row saying what it weighed before and after, and the setting that won.

With one photo, the desk shows it large, with a split you drag between the original and the result, and the preview follows the recipe as you change it. With many, it shows a contact sheet of your own thumbnails and a skyline: one bar per photo, with a line you drag down to see how many are over a size before anything runs.

What it will not do

How it is built

The whole thing is a static site: HTML, JavaScript and a Web Worker. There is no server behind it, no account, and no address that could receive a photograph. Photos are opened and compressed on this device. Nothing is uploaded.

JPEG and WebP are written by your browser’s own encoders, so the same photo can come out a few KB different in different browsers. PNG is written by UPNG (MIT licence), which tries the scanline filters and an optional palette and keeps whichever is smaller. HEIC is opened only by browsers that decode it themselves; no HEIC decoder is shipped with this site. The ZIP writer and the lossless JPEG rewriter (new Huffman tables, every coefficient kept) are our own.

What is most likely to be wrong

Written down rather than hidden. Resume recognises a file by its name, its size and the time it was last modified, which is fast and is not a proof of identity. The ceiling of five thousand files is a judgement rather than a measurement. The automatic number of files in flight, the megapixel budget behind it and the memory budget for finished copies are estimates from what the browser reports about the machine. Each is a trade made deliberately, and each could be made better with real numbers.