Skip to content

core(modern-images): update to include AVIF estimates#12682

Merged
patrickhulce merged 8 commits into
masterfrom
avif_audit
Jun 30, 2021
Merged

core(modern-images): update to include AVIF estimates#12682
patrickhulce merged 8 commits into
masterfrom
avif_audit

Conversation

@patrickhulce

Copy link
Copy Markdown
Collaborator

Summary
Updates the modern image formats audit to use AVIF file size estimates according to the plan outlined in #12295 (comment). I initially tried out showing both the WebP and AVIF estimates in the table, but a few problems:

  • Very crowded with the "Resource Size" already there as well.
  • The extra number provides basically no additional information since one is basically a simple multiple of the other.

Instead, this PR just replaces the estimate used for the audit results with the AVIF estimate, skips an image if it's already WebP, and moves the WebP estimate to a new property wastedWebpBytes.

Related Issues/PRs
closes #12295

@patrickhulce patrickhulce requested a review from a team as a code owner June 22, 2021 21:06
@patrickhulce patrickhulce requested review from connorjclark and removed request for a team June 22, 2021 21:06
@google-cla google-cla Bot added the cla: yes label Jun 22, 2021
description: 'Image formats like JPEG 2000, JPEG XR, and WebP often provide better ' +
description: 'Image formats like WebP and AVIF often provide better ' +
'compression than PNG or JPEG, which means faster downloads and less data consumption. ' +
'[Learn more](https://web.dev/uses-webp-images/).',

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docs updates here: GoogleChrome/web.dev#5696

@brendankenny brendankenny left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

  • closes #12295

    do we still want to move webp to uses-optimized-images at some point or are we dropping that idea and we're good to close that issue?

  • how do you feel about updating modern-image-formats entry in byte-efficiency/expectations.js to include some real level of detail? :) It's pretty light right now and I'm just realizing we don't appear to have any smoke tests for the image-elements -> modern-image-formats/uses-optimized-images pipeline beyond basically that they ran without error.

Comment thread lighthouse-core/audits/byte-efficiency/modern-image-formats.js
Comment thread lighthouse-core/audits/byte-efficiency/modern-image-formats.js
@patrickhulce

Copy link
Copy Markdown
Collaborator Author

do we still want to move webp to uses-optimized-images at some point or are we dropping that idea and we're good to close that issue?

I'm comfortable dropping that idea. Adding webp encoding to one's pipeline is an order of magnitude different (and more on par with AVIF) than trimming some fat on existing JPEGs. Our 4-part rating system of score, impact, difficulty, actionability would be helpful right about now :)

how do you feel about updating modern-image-formats entry in byte-efficiency/expectations.js to include some real level of detail? :) It's pretty light right now and I'm just realizing we don't appear to have any smoke tests for the image-elements -> modern-image-formats/uses-optimized-images pipeline beyond basically that they ran without error.

Yeah SG, though IIRC we avoided detail there because of the unreliable cross-platform differences of the encoding. That was probably before our +/- smokehouse support though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Evolve the next-generation image formats audit (AVIF)

4 participants