Why tiny JPEGs look different in Chrome
- Web
- Graphics
- Browsers
- Performance
- Developer Tools
The post digs into a small but very visible rendering quirk: a JPEG shrunk to icon size looked different in Chrome than in Firefox. The author tied it to Chrome using partial JPEG decode for aggressive downscaling, which can effectively throw away higher-frequency detail early and change the final look. People filled in the missing browser internals. Firefox is not doing a naive full decode and then scaling either. It uses downscale-during-decode, while Chrome's JPEG path leans on the 8x8 DCT structure more directly for speed. That made the comments land on a broader point than the original bug hunt. Browser image pipelines are full of performance shortcuts, and those shortcuts show up most on tiny UI assets, line art, repeated patterns, and high-contrast edges, not on normal photos where the optimization is usually invisible. The practical consensus was blunt: JPEG is the wrong format for icons, browsers also differ in their resampling choices, and even lossless formats can still look bad if you hand the browser a huge bitmap and ask it to crush it down. SVG came up as the cleanest fix for icons because it survives DPI and zoom changes better, though inline SVG can create its own DOM style and ID collision problems if you do not isolate it.
If image quality matters in UI, stop relying on browser defaults to rescue oversized assets. Ship vector icons where possible, provide raster images near their display size, and test cross-browser rendering at real zoom and DPI settings before rollout.
-
guillaumetech.github.io
- Discuss on HN