3 ms·
> Maybe re-encoding my website JPEGs to gain 20% size is not worth the 33% longer decode I changed all my .jpg files to .avif a few years ago. The benefit I ge
by shevy-java 21d ago
> Maybe re-encoding my website JPEGs to gain 20% size is not worth the 33% longer decode
I changed all my .jpg files to .avif a few years ago. The benefit I get is much more than 20%. Now there is some loss when I use high compression with .avif, in particular via gimp - but other than that, I gained a lot of file size here, definitely much more than 20%. It also depends on the image at hand; I noticed that images with a ton of details, such as if you photograph a garden, takes more space. But for simpler images, I have easily gains of about 60% or 70% compared to jpeg, with no or almost no loss in quality. Whereas if I were to use jpeg compression, the quality loss would be insanely high. When I noticed this, I decided to abandon .jpg for my own use cases. I had to choose back then between avif and webp and while webp is fine, I found .avif was slightly better for the use cases I had.
I don't quite know how much jpeg xl performs, but you mentioned JPEG so I had to comment on that 20% statement as I found it way too low.
I also find the claim "longer decode" not correct. I have some photographs of gardens and the file size is huge, in JPG. When I compressed and changed these into .avif, the resulting page loads soooooooo much faster now when having used avif and a considerable but acceptable compression of it. It is just no comparison at all - avif beats jpg with its eyes closed.
- cbolton 21d agoSorry if that was confusing, I have edited my post to clarify a bit: That sentence was about a feature specific to JPEG XL, which is that if you have JPEG files you can re-encode then as JPEG XL to save space without any loss of quality. It's nice for peace of mind, you can bulk convert a large archive and you know you still have the same pixels everywhere (later you can even turn them back to JPEG without loss if you want). AVIF cannot do that. Now if you are OK with some loss in the conversion, you can also do much better than 20% with JPEG XL.
- danudey 20d agoWorth mentioning that someone else in the comments converted their large library of JPEGs to JPEG XL for exactly this reason and only realized afterwards that they lost a ton of image metadata from the EXIF tags. This probably isn't what you would assume would happen for a bulk 'lossless conversion' so if you're going to do this then make sure you're validating the metadata too (if it matters to you).
- kps 20d agoThat's probably not the case. `cjxl` preserves metadata, but early on, some popular metadata extractors (exiftool, exiv2) silently ignored it.
- Broiler9437 20d agoI have no issue with EXIF here. Compressed JPEGs were reverted with zero data lost
- dialogbox 21d agoThat 20% gain is for the lossless re-encoding. It's not possible with .avif AFAIK. If you allow minor loss, jxl can save much more space.
- ComputerGuru 21d agoIt sounds like you lossily re-encoded lossy JPEGs to AVIF, am I reading that right? If so, you're automatically suffering from generational loss there, it can't be the basis of any coherent argument.