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

Add AVIF avatars #462

Merged
merged 1 commit into from
Sep 1, 2020
Merged

Add AVIF avatars #462

merged 1 commit into from
Sep 1, 2020

Conversation

mathiasbynens
Copy link
Member

Across all avatars, this saves 136.6 kB:

$ perl -le 'map { $sum += -s } @ARGV; print $sum' -- src/_img/avatars/*.jpg
447248

$ perl -le 'map { $sum += -s } @ARGV; print $sum' -- src/_img/avatars/*.avif
310680

@RReverser @surma @jakearchibald Thanks for adding AVIF support to Squoosh!

Across all avatars, this saves 136.6 kB:

    $ perl -le 'map { $sum += -s } @argv; print $sum' -- src/_img/avatars/*.jpg
    447248

    $ perl -le 'map { $sum += -s } @argv; print $sum' -- src/_img/avatars/*.avif
    310680
@mathiasbynens mathiasbynens added the meta Issues involving the build process or the website itself, rather than its content label Aug 27, 2020
@surma
Copy link
Contributor

surma commented Aug 27, 2020

Why not add WebP at the same time?

@mathiasbynens
Copy link
Member Author

Why not add WebP at the same time?

It didn’t seem worth the trouble — in a future where all browsers support AVIF, there’s no point in also serving WebP. Since Firefox and Chrome will already support AVIF soon, it’d only benefit Safari, and only until they add AVIF support.

@sayjeyhi
Copy link

sayjeyhi commented Aug 27, 2020

@mathiasbynens just out of curiosity, did you generate avatars with Squoosh or one of libavif or avifenc on homebrew?

@mathiasbynens
Copy link
Member Author

mathiasbynens commented Aug 28, 2020

@sayjeyhi I used Squoosh for a few avatars to easily (visually) find the “optimal” settings, and then used avifenc (installed through brew install joedrago/repo/avifenc) to automate the conversion with those settings for the remaining images. I hear the Squoosh team is considering batch support, which will make this even easier in the future!

Update: I just found out @kornelski has an alternative PNG/JPEG to AVIF converter: https://github.com/kornelski/cavif I’ll try this next time!

@surma
Copy link
Contributor

surma commented Aug 28, 2020

Firefox and Chrome will already support AVIF soon

“soon” seems optimistic esp. with regards to FF.

@mathiasbynens
Copy link
Member Author

Firefox and Chrome will already support AVIF soon

“soon” seems optimistic esp. with regards to FF.

Oh? You probably have more background than I do here. I was assuming it wouldn’t take too long anymore since Firefox has had AVIF support behind a flag for a while now but my assumption may be wrong.

Either way I’m not opposed to also adding WebP in a separate PR 👍 I was just explaining my thinking.

@mathiasbynens
Copy link
Member Author

Gonna go ahead and merge this since it seems uncontroversial.

@mathiasbynens mathiasbynens merged commit a51e7af into main Sep 1, 2020
@mathiasbynens mathiasbynens deleted the add-avif-avatars branch September 1, 2020 06:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes meta Issues involving the build process or the website itself, rather than its content
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants