Lighthouse Image Budget Follows a Simple Formula: Width Times Height Divided by 6
A developer reverse-engineered Google Lighthouse's image size audit and discovered it targets exactly one-sixth of a byte per pixel, expressed as w × h ÷ 6. By analyzing flagged images on their homepage, they confirmed the formula reproduced every wasted-bytes figure Lighthouse reported. Armed with this target, they built an automated pipeline using cwebp that only re-encodes images exceeding the calculated budget, leaving smaller files untouched. A separate Lighthouse complaint about oversized image dimensions uses a different formula based on displayed versus intrinsic pixel counts, and the two audits behave independently. The approach reduced reported image waste on the homepage from 345 KiB to zero, turning a vague warning into a concrete, reproducible build rule.
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