This content originally appeared on phpied.com and was authored by Stoyan
Chrome is making a change on how Largest Contentful Paint (LCP) core web vital (CWV) is being calculated in order to avoid abuse. The abuse is that people cheat by putting a fake "hero" image (imagine a stretched out 1x1 transparent gif) and have this counted as a sooner LCP event.
Chrome is fighting this by checking how much data is found in each pixel, a.k.a. image entropy, a.k.a. bits per pixel (BPP). And if the number is lower than 0.05, this image is not considered LCP worthy.
How can you tell your BPP/Enthropy
Option #1: drop your image to Tim's tool to test images from your filesystem
Option #2: use this quick JavaScript snippet in you console to test against a live site
console.table( [...document.images].map( img => [ img.currentSrc, performance.getEntriesByName(img.currentSrc)[0].encodedBodySize * 8 / (img.width * img.height) ] ) )
And one more thing
Test the actual LCP change in WebPageTest.org, Annie shows us how.
Here's the important bit for copy-pasting:
--enable-features=ExcludeLowEntropyImagesFromLCP:min_bpp/0.05
This content originally appeared on phpied.com and was authored by Stoyan
Stoyan | Sciencx (2023-04-13T22:09:01+00:00) Quick BPP (image entropy) check. Retrieved from https://www.scien.cx/2023/04/13/quick-bpp-image-entropy-check/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.