-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
Describe the problem
In enhanced-img the formats served are avif, webp, and one more fallback format for browsers that don't support those two. The fallback format is jpg, unless the original image is png, webp, or avif. I guess the reasoning was, that those formats are the ones that support lossless compression and we don't want to lossily compress images that might have been losslessly encoded in the first place. Except it doesn't really make sense because on modern browsers, the user will still receive avif/webp, compressed images, and that compression will be lossy. So all it does, is generate inefficient images. Also, pretty much all images displayed on the web are lossy anyways, and assuming that if the original image is webp/avif it's probably lossless is a stretch. And even if it was lossless, the user using enhanced-img implies that they want to optimize their image, and know that it means some lossy compression.
Describe the proposed solution
Just make the formats always avif;webp;jpg. Even if the original image is png. If user needs a lossless image they can specify ?format=avif;webp;png&lossless
Alternatives considered
No response
Importance
nice to have
Additional Information
No response