Conversation
This adds a simple calculation of image entropy, defined as the number of bytes in the image resource, divided by the rendered size of the image. If an image fails to meet the entropy threshold, then it is excluded as an LCP candidate image. Closes: #86
|
Open question - should the threshold be left as implementation-defined? This calculation could be effectively skipped by setting it to 0, if an implementor wanted to ignore entropy. |
|
Ian, is there anything prevent this from landing? I think we can start with 0.05 for now to make sure all implementations have the same value. If we want to allow implementations to ignore entropy, maybe we can specify this feature is optional rather than making entropy itself to be implementation-defined. |
|
I think that question was the only reason I hadn't landed it yet. I can add a word or two to make the step optional if the implementation doesn't want to consider entropy (if you think that's useful -- or else we can just make it part of the definition) |
|
Maybe just part of the definition I think? |
|
@clelland Ian, do you have data about how often an low entropy image is detected? Or how useful is this? Or any data related to how the threshold was picked? Thanks! |
|
The effective visual size algo already has a section to account for entropy, and a note about it. Some of this patch seems higher quality, but perhaps no longer relevant. I think there is desire to refactor the current algo to split out what is really about effective size vs "contentful" criteria like entropy. CC @shaseley as well. |
|
This patch can no longer land as-is, but, I'll take a stab at figuring out if any of its wording is worth keeping. Otherwise, I will close. In general, this section of the spec is likely to undergo more change, anyway. |
This adds a simple calculation of image entropy, defined as the number of bytes in the image resource, divided by the rendered size of the image. If an image fails to meet the entropy threshold, then it is excluded as an LCP candidate image.
Closes: #72, #86
Preview | Diff