libretro / RetroArch

Cross-platform, sophisticated frontend for the libretro API. Licensed GPLv3.
http://www.libretro.com
GNU General Public License v3.0
10.32k stars 1.84k forks source link

[Feature Request] Support for AVIF thumbnail images - Far smaller image file sizes #16109

Open PoloniumRain opened 10 months ago

PoloniumRain commented 10 months ago

Being as the thumbnails folder can take up gigabytes with large game collections, can you please consider supporting AVIF images?

AVIF is a modern image format based on the AV1 video codec. It's royalty-free and offers far superior compression when compared to JPG or WEBP images, and still beats the relatively new HEIC image format (which isn't royalty free). It's currently the best there is when it comes to compression vs image quality. Importantly it supports transparency, which is obviously useful for thumbnails, and there's also support for lossless images, animation, HDR and more.

As for AVIF adoption - All current web browsers and commonly used image viewers (like the Windows Photo app) have support for AVIF. Image editing software like GIMP has it built-in, while Photoshop has a plugin.

Right now the game thumbnails use PNG images, so when these use 32-bit colour and a decent resolution (900p-ish) they can bloat to around 2MB each. A compressed AVIF image will get extremely close to matching PNG lossless image quality while being ~70% smaller and still looking much better than JPG/WEBP at the same file size. Typically you can have around 30 - 40% smaller files than JPG or Googles WEBP while still matching the image quality, or have an AVIF image the same file size as JPG/WEBP but with considerably better image quality/less compression artifacts.

Here's some possibly useful info on AVIF decoding performance (incase you're worried about thumbnail loading times when scrolling through the playlist).

zoltanvb commented 9 months ago

Just putting here some thoughts:

I would have thought that without the online thumbnail downloader support, this kind of feature is of very limited use, but apparently people do construct their own thumbnail packs, so it makes sense even without touching the online part. The least intrusive way would be linking to libavif externally and putting the support behind a config option (to avoid the extra file queries). At the same time, probably it is reasonable to add #12236 as well, jpeg decoding is already there.