Compression test results: seven samples at 100KB to 1MB

Last updated November 14, 2026 · written by ew

Compressor sites love the phrase “no visible loss”. I wanted to know what my own code actually does, so I generated seven images of the kinds people usually need to upload and ran SlimPic’s compression function on each of them. Every number below comes from those runs, and the source files are here so you can repeat them.

About the samples

None of these are photographs. They are drawn in the browser by a script, because I did not want to publish real people’s photos and I wanted the same files every time the script runs. I tried to give them the traits of real uploads: 90,000 grass blades and sensor noise in the landscape, heavy grain in the low-light room, paper texture and a 0.23° tilt in the scan. They are still not camera photos, and the deliberate noise makes them harder to compress than a typical picture.

Test conditions. Measured 2026-11-14 with chromium 157.0.8103.51 (via Playwright) on an Apple M3, 16GB RAM, macOS 15.6.1. SlimPic’s own compress() from src/lib/compression.js was called on the main thread with “quality first” priority. Time is wall-clock time for one image. Quality is the encoder setting that produced the saved file. PSNR compares the result with the original after both are resampled to the same viewing width (photos 1280px, screenshots at native width); higher means closer to the original. Script: scripts/run-experiments.mjs; raw data: experiments/results/.

Overview: Auto setting

Each cell shows output dimensions, quality setting and file size. “Unchanged” means the original was already under the target and was returned as is.

SampleOriginal100KB target200KB target500KB target1MB target
Landscape (phone camera size)3.64MB
4032×3024
1190×892
q0.63 · 98.9KB
1901×1426
q0.52 · 199KB
3006×2255
q0.57 · 499KB
4000×3000
q0.63 · 992KB
Low-light interior (noisy)4.29MB
4032×3024
1400×1050
q0.76 · 97.0KB
1929×1447
q0.73 · 192KB
3051×2288
q0.64 · 486KB
4000×3000
q0.61 · 996KB
Product shot (light background)1.32MB
3000×3000
1752×1752
q0.68 · 97.4KB
2479×2479
q0.62 · 196KB
3000×3000
q0.76 · 491KB
3000×3000
q0.84 · 996KB
Phone chat screenshot429KB
1179×2556
1179×2556
q0.86 · 99.7KB
1179×2556
q0.98 · 175KB
unchangedunchanged
PC spreadsheet screenshot (13px text)283KB
1920×1080
1920×1080
q0.87 · 99.4KB
1920×1080
q0.98 · 139KB
unchangedunchanged
A4 scan at 300dpi1.59MB
2480×3508
1257×1778
q0.65 · 98.3KB
1778×2515
q0.61 · 199KB
2480×3508
q0.57 · 492KB
2480×3508
q0.75 · 773KB
Logo with transparency1.84MB
2000×2000
2000×2000
q0.61 · 99.9KB
2000×2000
q0.94 · 197KB
2000×2000
q0.98 · 260KB
2000×2000
q0.98 · 260KB

What stood out

A smaller target does not always mean a lower quality setting. The landscape used quality 0.63 at 100KB but 0.52 at 200KB. The code first tries the full size down to quality 0.48, then shrinks the image and searches again. At 100KB the width had already dropped to 1190px, which left room for a higher setting. The quality number alone tells you little.

4032×3024 becomes 4000×3000 even at 1MB. Encoding is capped at 12 million pixels, and the usual phone size is 12.19 million. While measuring I also found that this cap caused files already under the target to be re-encoded; a 3.64MB photo with a 5MB target came back at 4.49MB. That is fixed now.

WebP is slow. Fitting the landscape into 1MB took 14.1s as WebP and 1.0s as JPG. WebP scored slightly higher at the same size (38.6 dB vs 37.5 dB). The transparent logo, which Auto saves as WebP, took 7.2s at 100KB.

PNG is a poor choice for photos. PNG has no quality setting, so the only way to hit a target is to shrink the image. The landscape as a 1MB PNG came out at 761×571.

Do not compare PSNR across samples. The low-light room scores higher than the landscape mostly because it is a big flat wall. The numbers are useful for comparing settings on the same sample. From looking at the crops, results above about 40 dB needed a side-by-side comparison to spot differences, while anything under 32 dB looked smeared without zooming.

Zoomed crops: landscape

A 480×320 crop of the treeline and lake, scaled to the same size. The sensor grain disappears first. At 100KB the ripples turn into soft bands and the trees into green mush. At 200KB some leaf detail returns, but the water texture is still gone. Around 500KB it starts to look like the original.

Original crop
Original
Crop of result: JPG · 98.9KB · 1190×892 · q0.63
JPG · 98.9KB · 1190×892 · q0.63
Crop of result: JPG · 199KB · 1901×1426 · q0.52
JPG · 199KB · 1901×1426 · q0.52
Crop of result: JPG · 499KB · 3006×2255 · q0.57
JPG · 499KB · 3006×2255 · q0.57

The scan held up better. At 200KB (width 1778px) the 30px footnotes were still readable, with faint smudges around the letters and the paper texture smoothed away. The thin ring of the stamp was softer than in the original.

Original crop
Original
Crop of result: JPG · 199KB · 1778×2515 · q0.61
JPG · 199KB · 1778×2515 · q0.61

Full tables per sample

All four output settings at all four targets. For JPG inputs, Auto and JPG produce byte-identical files.

Landscape (phone camera size): original 3.64MB, 4032×3024px
Landscape (phone camera size): original 3.64MB, 4032×3024px
SettingTargetResultOutputSize (px)QualityTimePSNR
Auto100KB98.9KBJPG1190×8920.63590ms29.9
Auto200KB199KBJPG1901×14260.52623ms32.2
Auto500KB499KBJPG3006×22550.57923ms35.1
Auto1MB992KBJPG4000×30000.631.0s37.5
JPG100KB98.9KBJPG1190×8920.63550ms29.9
JPG200KB199KBJPG1901×14260.52580ms32.2
JPG500KB499KBJPG3006×22550.57886ms35.1
JPG1MB992KBJPG4000×30000.631.0s37.5
WebP100KB99.8KBWebP1430×10720.585.4s31.5
WebP200KB200KBWebP2023×15170.687.8s33.9
WebP500KB499KBWebP4000×30000.5112.8s36.6
WebP1MB982KBWebP4000×30000.8014.1s38.6
PNG100KB87.9KBPNG238×1780.98772ms26.0
PNG200KB174KBPNG336×2520.98704ms26.9
PNG500KB432KBPNG538×4040.98709ms29.0
PNG1MB858KBPNG761×5710.98686ms31.4
Low-light interior (noisy): original 4.29MB, 4032×3024px
Low-light interior (noisy): original 4.29MB, 4032×3024px
SettingTargetResultOutputSize (px)QualityTimePSNR
Auto100KB97.0KBJPG1400×10500.76532ms37.0
Auto200KB192KBJPG1929×14470.73640ms38.0
Auto500KB486KBJPG3051×22880.64963ms39.4
Auto1MB996KBJPG4000×30000.611.2s40.2
JPG100KB97.0KBJPG1400×10500.76578ms37.0
JPG200KB192KBJPG1929×14470.73635ms38.0
JPG500KB486KBJPG3051×22880.64985ms39.4
JPG1MB996KBJPG4000×30000.611.2s40.2
WebP100KB91.0KBWebP1496×11220.855.3s37.6
WebP200KB199KBWebP2115×15860.817.5s38.4
WebP500KB476KBWebP3345×25080.7413.8s39.1
WebP1MB969KBWebP4000×30000.6615.4s39.5
PNG100KB78.3KBPNG254×1910.98858ms31.2
PNG200KB166KBPNG360×2700.98766ms32.2
PNG500KB373KBPNG531×3980.98768ms33.8
PNG1MB791KBPNG751×5630.98770ms35.9
Product shot (light background): original 1.32MB, 3000×3000px
Product shot (light background): original 1.32MB, 3000×3000px
SettingTargetResultOutputSize (px)QualityTimePSNR
Auto100KB97.4KBJPG1752×17520.68387ms40.8
Auto200KB196KBJPG2479×24790.62586ms41.8
Auto500KB491KBJPG3000×30000.76639ms47.5
Auto1MB996KBJPG3000×30000.84748ms48.7
JPG100KB97.4KBJPG1752×17520.68415ms40.8
JPG200KB196KBJPG2479×24790.62553ms41.8
JPG500KB491KBJPG3000×30000.76641ms47.5
JPG1MB996KBJPG3000×30000.84714ms48.7
WebP100KB99.6KBWebP2550×25500.718.1s42.3
WebP200KB195KBWebP3000×30000.778.6s44.5
WebP500KB450KBWebP3000×30000.879.5s46.6
WebP1MB898KBWebP3000×30000.9210.6s48.5
PNG100KB91.4KBPNG283×2830.98390ms31.8
PNG200KB150KBPNG380×3800.98307ms33.4
PNG500KB396KBPNG602×6020.98314ms36.0
PNG1MB808KBPNG851×8510.98326ms38.8
Phone chat screenshot: original 429KB, 1179×2556px
Phone chat screenshot: original 429KB, 1179×2556px
SettingTargetResultOutputSize (px)QualityTimePSNR
Auto100KB99.7KBWebP1179×25560.862.4s42.9
Auto200KB175KBWebP1179×25560.98215ms44.2
Auto500KB429KBPNG (original returned)1179×2556-0ms∞
Auto1MB429KBPNG (original returned)1179×2556-1ms∞
JPG100KB99.9KBJPG1002×21720.60174ms31.8
JPG200KB194KBJPG1179×25560.85202ms40.6
JPG500KB388KBJPG1179×25560.9830ms44.1
JPG1MB388KBJPG1179×25560.9828ms44.1
WebP100KB99.7KBWebP1179×25560.862.1s42.9
WebP200KB175KBWebP1179×25560.98235ms44.2
WebP500KB175KBWebP1179×25560.98217ms44.2
WebP1MB175KBWebP1179×25560.98206ms44.2
PNG100KB85.5KBPNG300×6510.9851ms23.1
PNG200KB199KBPNG545×11830.9889ms27.7
PNG500KB429KBPNG (original returned)1179×2556-1ms∞
PNG1MB429KBPNG (original returned)1179×2556-1ms∞
PC spreadsheet screenshot (13px text): original 283KB, 1920×1080px
PC spreadsheet screenshot (13px text): original 283KB, 1920×1080px
SettingTargetResultOutputSize (px)QualityTimePSNR
Auto100KB99.4KBWebP1920×10800.871.6s43.5
Auto200KB139KBWebP1920×10800.98190ms44.6
Auto500KB283KBPNG (original returned)1920×1080-1ms∞
Auto1MB283KBPNG (original returned)1920×1080-1ms∞
JPG100KB99.4KBJPG1533×8620.61122ms27.1
JPG200KB198KBJPG1920×10800.82141ms40.4
JPG500KB336KBJPG1920×10800.9832ms45.4
JPG1MB336KBJPG1920×10800.9821ms45.4
WebP100KB99.4KBWebP1920×10800.871.5s43.5
WebP200KB139KBWebP1920×10800.98167ms44.6
WebP500KB139KBWebP1920×10800.98150ms44.6
WebP1MB139KBWebP1920×10800.98142ms44.6
PNG100KB94.4KBPNG731×4110.9873ms23.4
PNG200KB166KBPNG1017×5720.9849ms24.6
PNG500KB283KBPNG (original returned)1920×1080-1ms∞
PNG1MB283KBPNG (original returned)1920×1080-1ms∞
A4 scan at 300dpi: original 1.59MB, 2480×3508px
A4 scan at 300dpi: original 1.59MB, 2480×3508px
SettingTargetResultOutputSize (px)QualityTimePSNR
Auto100KB98.3KBJPG1257×17780.65354ms33.8
Auto200KB199KBJPG1778×25150.61530ms38.4
Auto500KB492KBJPG2480×35080.57642ms40.6
Auto1MB773KBJPG2480×35080.75757ms43.6
JPG100KB98.3KBJPG1257×17780.65348ms33.8
JPG200KB199KBJPG1778×25150.61489ms38.4
JPG500KB492KBJPG2480×35080.57666ms40.6
JPG1MB773KBJPG2480×35080.75715ms43.6
WebP100KB93.6KBWebP1825×25820.736.7s38.3
WebP200KB186KBWebP2480×35080.548.7s39.8
WebP500KB441KBWebP2480×35080.7510.0s41.0
WebP1MB999KBWebP2480×35080.8311.3s43.3
PNG100KB90.6KBPNG211×2990.98354ms22.6
PNG200KB174KBPNG303×4290.98347ms23.6
PNG500KB419KBPNG475×6710.98325ms25.4
PNG1MB843KBPNG672×9490.98330ms27.9
Logo with transparency: original 1.84MB, 2000×2000px
Logo with transparency: original 1.84MB, 2000×2000px
SettingTargetResultOutputSize (px)QualityTimePSNR
Auto100KB99.9KBWebP2000×20000.617.2s44.9
Auto200KB197KBWebP2000×20000.947.4s47.3
Auto500KB260KBWebP2000×20000.98736ms47.6
Auto1MB260KBWebP2000×20000.98788ms47.6
JPG100KB99.7KBJPG2000×20000.79275ms43.7
JPG200KB189KBJPG2000×20000.94252ms46.7
JPG500KB325KBJPG2000×20000.9854ms47.4
JPG1MB325KBJPG2000×20000.9857ms47.4
WebP100KB99.9KBWebP2000×20000.617.2s44.9
WebP200KB197KBWebP2000×20000.947.4s47.3
WebP500KB260KBWebP2000×20000.98745ms47.6
WebP1MB260KBWebP2000×20000.98735ms47.6
PNG100KB81.0KBPNG353×3530.9898ms34.0
PNG200KB184KBPNG589×5890.9895ms37.8
PNG500KB378KBPNG960×9600.98103ms43.8
PNG1MB861KBPNG1358×13580.98111ms48.5

Browsers give different results

The code is the same, but the browser does the encoding. I reran a subset in the Firefox and WebKit builds that come with Playwright. At 200KB, WebKit shrank the landscape to 1232px wide where Chrome kept 1901px; its JPEG encoder seems to produce larger files at the same setting.

Sample / targetChrome 157.0.8103.51Firefox (Playwright) 155.0WebKit (Playwright) 26.6
Landscape (phone camera size)
200KB
JPG 1901×1426
199KB · 681ms · PSNR 32.2
JPG 1497×1123
197KB · 626ms · PSNR 28.6
JPG 1232×923
193KB · 576ms · PSNR 29.6
Landscape (phone camera size)
500KB
JPG 3006×2255
499KB · 902ms · PSNR 35.1
JPG 2787×2090
500KB · 785ms · PSNR 31.9
JPG 2293×1719
489KB · 693ms · PSNR 35.0
Landscape (phone camera size)
1MB
JPG 4000×3000
992KB · 1.1s · PSNR 37.5
JPG 4000×3000
978KB · 861ms · PSNR 34.2
JPG 3242×2432
980KB · 1.0s · PSNR 38.7
Phone chat screenshot
200KB
WebP 1179×2556
175KB · 196ms · PSNR 44.2
WebP 1179×2556
175KB · 228ms · PSNR 44.2
JPG 1179×2556
198KB · 267ms · PSNR 40.0
PC spreadsheet screenshot (13px text)
100KB
WebP 1920×1080
99.4KB · 1.6s · PSNR 43.5
WebP 1920×1080
97.7KB · 1.6s · PSNR 43.5
JPG 1249×702
99.4KB · 172ms · PSNR 26.2
A4 scan at 300dpi
200KB
JPG 1778×2515
199KB · 516ms · PSNR 38.4
JPG 1597×2260
196KB · 472ms · PSNR 37.3
JPG 1004×1421
200KB · 354ms · PSNR 32.3
Logo with transparency
100KB
WebP 2000×2000
99.9KB · 7.5s · PSNR 44.9
WebP 2000×2000
99.5KB · 10.9s · PSNR 44.7
PNG 437×437
92.9KB · 272ms · PSNR 35.3
Logo with transparency
200KB
WebP 2000×2000
197KB · 7.7s · PSNR 47.3
WebP 2000×2000
200KB · 11.5s · PSNR 47.2
PNG 595×595
162KB · 246ms · PSNR 37.8

WebKit cannot encode WebP. Before a fix made during these tests, Auto fell back to PNG there, which cut a 200KB phone screenshot to 617px wide. Images without transparency now fall back to JPEG instead and keep their width, as the table shows. Playwright’s WebKit is not the same as Safari on an iPhone, so I cannot promise identical numbers on a phone.

What this does not show

All runs were on one laptop; phones will be slower. The samples are synthetic and do not represent an average compression ratio. PSNR does not always match what your eyes see, so check the crops as well. If you get very different results, send me your browser, device and file size and I will try the same conditions.