nucliweb / image-element

Repository to collect best practices for web images 🏞
MIT License
413 stars 20 forks source link

JPEGXL 0.01%, & maybe not AVIF #4

Open tomByrer opened 2 years ago

tomByrer commented 2 years ago

I do not think JPEGXL should be recommended at all, & likely not for 6mo+, if that. Has needed a flag for a year. Is promising, but we're not there yet. https://caniuse.com/jpegxl Only browser I know with it turned on is Thornium, & it has no market share. https://github.com/Alex313031/Thorium#features--differences-between-chromium-and-thorium--

Also, I'm on the fence with AVIF. There is no hardware accelerations AFAIK; so images could actually 'time-to-glass' slower due to decoding time. There was some talk about tapping into Apple Silicons' AV1 hardware decoding, but I'm not aware if that got implemented & if other chips & OSes can do that. Secondly I found some color shifting with AVIF; likely because it seems to convert back & forth color spaces.

nucliweb commented 2 years ago

Hi @tomByrer, thank you for you feedback.

I'm agree about the JPEG XL support, I'm a early adopter 😅

About the AVIF image format, your examples are of screenshots, AVIF is not the best format to images with text, I'm going to take a closer look at that issue, thanks for sharing.

Btw, the idea of the repo is to know to use the image tag to improve the UX and the Web Performance, I'm not advising that one format is better than another, that depends a lot on the images.

tomByrer commented 2 years ago

AVIF is not the best format to images with text,

Oh, I need to test that; thanks! I think AVIF is good for pictures (landscapes, portraits). Might be trouble if keeping specific colors exact (eg branding colors, match image colors with CSS colors).

Just keep in mind how many programmers just copy/paste ;)

antermin commented 1 year ago

https://twitter.com/jensimmons/status/1666058844122894336

Yes, Safari 17 supports JPEG XL. On macOS Sonoma, macOS Ventura and macOS Monterey, as well as iOS, iPadOS, watchOS, and soon, visionOS.

See also: https://caniuse.com/jpegxl

According to https://gs.statcounter.com/ , Safari has a market share of 20%.

It's true that JPEG XL previously has little adoption, but now that Apple has become an adopter, perhaps we should recommend it?