Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 8 commits into from
Jun 30, 2021
Merged

Conversation

patrickhulce
Copy link
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
@@ -16,7 +16,7 @@ const UIStrings = {
/** Imperative title of a Lighthouse audit that tells the user to serve images in newer and more efficient image formats in order to enhance the performance of a page. A non-modern image format was designed 20+ years ago. This is displayed in a list of audit titles that Lighthouse generates. */
title: 'Serve images in next-gen formats',
/** Description of a Lighthouse audit that tells the user *why* they should use newer and more efficient image formats. This is displayed after a user expands the section to see more. No character length limits. 'Learn More' becomes link text to additional documentation. */
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
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

Copy link
Member

@brendankenny brendankenny left a comment

Choose a reason for hiding this comment

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

LGTM!

  • closes Evolve the next-generation image formats audit (AVIF) #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.

@patrickhulce
Copy link
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