Why tiny JPEGs look different in Chrome(guillaumetech.github.io)
332 points by gutechh 9 days ago | 68 comments
tl;dr: Chrome (via Skia and libjpeg-turbo) optimizes small JPEG rendering using partial IDCT scaling: instead of fully decoding a JPEG and downsampling, it decodes directly at fractions with denominator 8 by discarding high-frequency DCT coefficients, then does traditional scaling for the rest. For tiny images, this can mean only the constant (flat color) component of each 8×8 block survives, dropping edge detail and gradients—making icons look thicker or different than in Firefox. Lesson: don't use JPEG for icons; it's optimized for photos.
HN Discussion:
  • Reinforces the lesson by advocating for appropriately sized images regardless of format
  • Confirms similar icon-breaking issues occurred with Chrome's optimization in real products
  • Article tells only one side; Firefox's approach and scaling algorithm differences deserve more coverage
  • ~Browser downscaling in general is unreliable; issue is broader than partial IDCT
  • Suggests alternative formats like ICO, PNG, or CSS controls as practical workarounds