By the Cuelark Team. Measured on 25 November 2026, between 11:05 and 11:11 AM IST. Disclosure: we make Cuelark Tools, including a browser-based compressor that aims at a file-size cap. This study measures command-line encoders, not our website and not other online tools. Every number comes from the run described below.
Job portals, exam forms and many mail systems still ask for a photo under 100 KB. That is a tight budget: a 2,400-pixel picture as a PNG is several megabytes, so 100 KB is often a 50-to-1 cut. The usual advice is “just lower the quality.” We wanted a measured answer to a fairer question: at the same 100,000-byte cap, which format and which strategy keep the most quality, and does that depend on the picture?
We compressed five pictures — two photographs, a screenshot, a flat graphic and a text form — with JPEG, WebP, AVIF, JPEG XL and lossless PNG. We used two strategies: change quality only, and allow a resize first. Quality was scored with SSIM (and PSNR) at a shared 800-pixel viewing width.
The short answer
- On both photographs, shrinking the picture and then raising quality beat crushing quality at full size, in every format. The gap was largest for JPEG on the tulip photo: SSIM 0.756 at full size (quality 4) versus 0.864 after a resize to 1,200 px.
- No single format won every picture. On the bridge photo, JPEG XL after a resize to 800 px kept the most quality (SSIM 0.980). On the tulip close-up, AVIF won (0.912); JPEG XL (0.863) was level with JPEG (0.864).
- If a lossless PNG already fits, use it. Our screenshot was 90.7 KB as PNG and our graphic was 55.1 KB, both with SSIM 1.000. Lossy compression is unnecessary there. JPEG XL at quality 100 also produced a pixel-identical copy of the screenshot, in 43.8 KB — about half the PNG.
- Lossless PNG is a poor way to force a photo under 100 KB. The bridge photo only fitted as PNG at 300 px (SSIM 0.833). The tulip photo needed 200 px (SSIM 0.553). The form needed 300 px (SSIM 0.734). All three scores are well below the best lossy results.
Results table
The cap is 100,000 bytes (100 KB, not 102,400). “Best under the cap” is the resize-and-quality search described in the method: we try several widths, at each width we take the highest encoder quality that still fits, and we keep the candidate with the highest SSIM at 800 px wide. SSIM is shown to three decimals; bytes are exact.
Best result at or under 100,000 bytes
| Picture | JPEG | WebP | AVIF | JPEG XL | PNG |
|---|---|---|---|---|---|
| Bridge photo | 0.954, 99,902 B, 800×450, q=90 | 0.964, 93,594 B, 800×450, q=92 | 0.969, 99,456 B, 1,000×563, q=76 | 0.980, 93,833 B, 800×450, q=92 | Did not fit at 400 px or larger |
| Tulip photo | 0.864, 99,693 B, 1,200×975, q=18 | 0.899, 99,358 B, 800×650, q=43 | 0.912, 97,187 B, 800×650, q=46 | 0.863, 99,559 B, 800×650, q=71 | Did not fit at 400 px or larger |
| Screenshot | 0.996, 99,423 B, 1,400×788, q=90 | 0.998, 98,336 B, 1,920×1,080, q=99 | 0.998, 71,475 B, 1,920×1,080, q=100 | 1.000 (lossless), 43,839 B, 1,920×1,080, q=100 | 1.000, 90,674 B, 1,920×1,080 |
| Graphic | 0.986, 99,956 B, 1,400×1,050, q=66 | 0.994, 98,632 B, 1,600×1,200, q=94 | 0.996, 43,701 B, 1,600×1,200, q=100 | 0.996, 92,172 B, 800×600, q=98 | 1.000, 55,109 B, 1,600×1,200 |
| Form page | 0.891, 96,990 B, 1,240×1,754, q=29 | 0.914, 98,398 B, 1,240×1,754, q=45 | 0.915, 93,857 B, 848×1,200, q=70 | 0.898, 96,292 B, 848×1,200, q=80 | Did not fit at 400 px or larger |
Bold is the highest SSIM for that picture. For the screenshot, JPEG XL and PNG are both lossless; JPEG XL is just smaller. For the graphic, PNG is the only lossless result and the highest SSIM.
Quality only, at the original size
This is the “lower the quality slider and leave the pixels alone” path.
| Picture | JPEG | WebP | AVIF | JPEG XL | PNG |
|---|---|---|---|---|---|
| Bridge photo | 0.901, 99,498 B, q=11 | 0.942, 99,216 B, q=8 | 0.959, 97,212 B, q=29 | 0.962, 97,562 B, q=19 | 4,708,142 B, does not fit |
| Tulip photo | 0.756, 81,642 B, q=4 | 0.810, 91,746 B, q=0 | 0.888, 94,154 B, q=13 | 0.812, 96,028 B, q=3 | 8,759,866 B, does not fit |
| Screenshot | 0.995, 99,703 B, q=68 | 0.998, 98,336 B, q=99 | 0.998, 71,475 B, q=100 | 1.000, 43,839 B, q=100 | 90,674 B, fits |
| Graphic | 0.981, 99,933 B, q=51 | 0.994, 98,632 B, q=94 | 0.996, 43,701 B, q=100 | 0.994, 98,376 B, q=79 | 55,109 B, fits |
| Form page | 0.891, 96,990 B, q=29 | 0.914, 98,398 B, q=45 | 0.906, 89,362 B, q=50 | 0.879, 99,672 B, q=50 | 781,946 B, does not fit |
The tulip JPEG at quality 4 is already under the cap (81,642 bytes) and still looks poor. Spending the leftover bytes would have meant a higher quality, but quality 5 was over 100,000 bytes, so 4 was the highest setting that fitted.
What the pictures look like
The cover and the bridge-photo crops use Frank Schulenburg's Golden Gate photograph, CC BY-SA 4.0. The tulip crops use Elena.laps' Keukenhof photograph, same licence. Links are in the method.
On the tulip photo, full-size JPEG at quality 4 smears the petals and the grass. Resizing to 1,200 px and encoding at quality 18 is clearly cleaner, and AVIF at 800 px is cleaner still. Even the best result (SSIM 0.912) is a long way from perfect: 100 KB is a hard budget for this picture.
On the bridge photo the differences are quieter but still visible. Full-size JPEG at quality 11 softens the cables and adds banding in the sky. The 800 px JPEG at quality 90 is sharper. JPEG XL at the same width is closest to the original (SSIM 0.980) and used 93,833 bytes, so it had a little room left under the cap.
The strategy chart is the most repeatable result in the study. For every lossy format on both photographs, the resize-and-quality search beat quality-only. The lift was about 0.05 SSIM for JPEG on the bridge photo (0.901 → 0.954) and about 0.11 for JPEG on the tulip photo (0.756 → 0.864). AVIF gained less, because it was already stronger at full size, but it still gained.
The form was a partial exception: JPEG and WebP already did their best at the original 1,240×1,754 size. AVIF and JPEG XL improved slightly after a shrink to 1,200 px on the long side. On the form, WebP at full size (0.914) was almost even with the best AVIF (0.915). JPEG XL was behind both.
When PNG is the right answer, and when it isn’t
A lossless PNG of the screenshot (90,674 bytes) and of the graphic (55,109 bytes) already fitted the cap, with SSIM 1.000. In both cases that is the quality winner. You would only pick a lossy format if you needed a still smaller file, or a format a form will not accept.
Two JPEG XL results are worth separating from that. At quality 100, the encoder switched to a lossless mode (the file shrank from 81,098 bytes at quality 99 to 43,839 bytes at quality 100). We decoded that screenshot file and compared it to the original, pixel for pixel: the maximum difference was 0. So JPEG XL can, on this kind of image, beat PNG on size without giving up a single pixel. The graphic did not go lossless: the best JPEG XL result was SSIM 0.996 at 92,172 bytes, still behind the 55,109-byte PNG.
The photographs and the form never fitted as PNG at 400 px or larger. After the main run we tried 350, 300, 250 and 200 px on the long side, with the same Lanczos filter and maximum PNG compression:
| Picture | Smallest long side we tried that fitted | Size | SSIM at 800 px |
|---|---|---|---|
| Bridge photo | 300×169 | 81,033 B | 0.833 |
| Tulip photo | 200×163 | 79,391 B | 0.553 |
| Form page | 212×300 | 74,944 B | 0.734 |
Those SSIM scores are far below the best lossy results. A 200-pixel photo also fails most form dimension rules. For a photograph that must be under 100 KB, a lossy format is the practical choice.
A side note on sharp screenshots: when we resized the 90.7 KB screenshot PNG to 1,600 px, the new PNG grew to 192 KB and no longer fitted. Lanczos resampling of sharp text introduces new intermediate colours, which a lossless PNG has to store. Shrinking a screenshot is not a free way to save bytes.
How we measured
When and where. 25 November 2026, 11:05:44 to 11:10:56 AM IST, on one Linux machine. The extra PNG size-threshold checks and the AVIF 4:4:4 footnote were run immediately after, around 11:11–11:12 AM IST.
The cap. 100,000 bytes. Some systems treat “100 KB” as 102,400 bytes (100 KiB). We used the tighter figure and say so.
The pictures. Two photographs from Wikimedia Commons, converted to 8-bit sRGB PNG and resized so the long side is 2,400 px (Lanczos), which is still a large image:
- Bridge photo — Golden Gate Bridge as seen from Marshall’s Beach, March 2018 by Frank Schulenburg, CC BY-SA 4.0. Reference: 2,400×1,350.
- Tulip photo — Tulips and tree at Keukenhof gardens by Elena.laps, CC BY-SA 4.0. Reference: 2,400×1,950.
And three pictures we generated, so they can be rebuilt bit for bit from the script:
- Screenshot — 1,920×1,080 synthetic desktop-app window, with a table, a bar chart and 11-pixel footnotes.
- Graphic — 1,600×1,200 flat poster: bold type, thin 1-pixel lines, solid colour blocks.
- Form page — 1,240×1,754 synthetic A4 form at 150 dpi, with body text and a light paper grain.
Formats and encoders. Quality is always an integer 0–100. We used each encoder’s reference (or standard) command-line tool, at its documented default effort/speed unless noted:
- JPEG: libjpeg-turbo 2.1.5
cjpeg -optimize -quality Q - WebP: libwebp 1.5.0
cwebp -m 4 -q Q(-m 4is the documented default) - AVIF: libavif 1.2.1 with libaom v3.12.1,
avifenc --codec aom --speed 6 --yuv 420 -q Q(--speed 6is the documented default) - JPEG XL: libjxl 0.11.2
cjxl --effort 7 -q Q(--effort 7is the documented default) - PNG: the original reference file, or a Lanczos resize written with ImageMagick at PNG compression level 9. There is no quality slider.
We decoded each result with the matching official decoder (djpeg/ImageMagick, dwebp, avifdec, djxl) before measuring.
Two strategies.
- Quality only. Keep the original pixels. Binary-search quality for the highest setting whose file is ≤ 100,000 bytes. If quality 0 still overflows, it does not fit.
- Resize, then quality. For long sides of 2,400, 2,000, 1,600, 1,400, 1,200, 1,000, 800, 600 and 400 px (only those no larger than the original), resize with Lanczos, then repeat the quality search. Among the files that fit, keep the one with the highest SSIM at 800 px; ties go to more pixels, then to more bytes (closer to the cap).
Quality metric. ImageMagick 7.1.1-43 compare -metric SSIM and compare -metric PSNR. For every comparison we resized both the reference and the decoded file to 800 px wide with Lanczos (or to the original width if it was already narrower). That matches the size a form or an article typically displays a photo. SSIM of 1 means the two 800 px images are identical; higher PSNR (dB) is also better. On the lossless JPEG XL screenshot, ImageMagick printed PSNR as 0 (0) for identical images; we compared the pixels directly, found no difference, and recorded PSNR as infinity.
AVIF 4:2:0. All AVIF numbers in the tables use 4:2:0 chroma, which is the usual setting for web photos. That means even quality 100 cannot be mathematically lossless, because half the colour samples are discarded. As a check, we also encoded the screenshot and the graphic at quality 100 with --yuv 444. Neither was pixel-identical (the screenshot file was 89,236 bytes, with a maximum per-channel difference of 2; the graphic was 47,835 bytes, with a maximum difference of 1). Those two files are not in the table.
Limits of the test
-
These are encoders, not websites. We did not run TinyPNG, Squoosh, iLoveIMG or any other online tool. A website may preprocess, pick different defaults, or use another encoder build. A different
--speed,--effortor-mwould also change the bytes and the SSIM. We used each tool’s documented default effort so the run is repeatable in a few minutes. - Five pictures are not the whole world. The tulip photo is a hard case (fine detail, saturated colour). The bridge photo is easier (smooth sky and water). Other photos will land between them, or outside.
- SSIM is a useful score, not a verdict from a human. We published crops so you can look. On the form page, AVIF’s best SSIM (0.915) was slightly above its full-size score (0.906), while PSNR went down (37.3 dB → 34.8 dB). We ranked candidates by SSIM, as decided before the run, and we report both numbers in the raw data.
- We did not test colour profiles in the output, animation, transparency or metadata. References were 8-bit sRGB with metadata stripped. Real camera files may behave differently.
- We make a compressor. That is why the method, the scripts, the encoder versions and the raw files are published with this post. If you repeat the test and get a different result, tell us and we will update the table with the date.
If you want to do a resize-and-quality search in a browser, for a size cap such as 100 KB, 50 KB or 20 KB, we have a tool that does that on Cuelark’s compress-to-100 KB page. It was not one of the encoders in this test.
Cuelark Team




Top comments (0)