Shrinking a 1.6 MB Hero JPEG to Under 200 KB Without Visible Loss
A marketing site's mobile Lighthouse score was dragged down by a single 2400×1600 hero photo of about 1.7 MB, which pushed largest contentful paint to 4.8 seconds on throttled 4G. The author needed a solution that required no build step, kept customer photos off third-party APIs, and still looked good at full size on large displays. Plain quality reduction caused gradient banding, so resizing to 1600 pixels wide combined with optimized, progressive 4:4:4 encoding did most of the work, bringing the file to roughly 197 KB. Switching to Node's sharp library with mozjpeg, along with WebP and AVIF variants, cut sizes further, with AVIF at about 43 KB. The author still serves JPEG and WebP fallbacks alongside AVIF, since browser support is not universal.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.



Discussion (0)
Log in to join the discussion and vote.
Log in