Quick BPP (image entropy) check

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 1×1 transparent gif) and have this counted as a sooner LCP event. Chrome is fighting this […]


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


Print Share Comment Cite Upload Translate Updates
APA

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/

MLA
" » Quick BPP (image entropy) check." Stoyan | Sciencx - Thursday April 13, 2023, https://www.scien.cx/2023/04/13/quick-bpp-image-entropy-check/
HARVARD
Stoyan | Sciencx Thursday April 13, 2023 » Quick BPP (image entropy) check., viewed ,<https://www.scien.cx/2023/04/13/quick-bpp-image-entropy-check/>
VANCOUVER
Stoyan | Sciencx - » Quick BPP (image entropy) check. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2023/04/13/quick-bpp-image-entropy-check/
CHICAGO
" » Quick BPP (image entropy) check." Stoyan | Sciencx - Accessed . https://www.scien.cx/2023/04/13/quick-bpp-image-entropy-check/
IEEE
" » Quick BPP (image entropy) check." Stoyan | Sciencx [Online]. Available: https://www.scien.cx/2023/04/13/quick-bpp-image-entropy-check/. [Accessed: ]
rf:citation
» Quick BPP (image entropy) check | Stoyan | Sciencx | 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.

You must be logged in to translate posts. Please log in or register.