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

Allow generating other image formats #630

Open
razzeee opened this issue Apr 30, 2024 · 2 comments
Open

Allow generating other image formats #630

razzeee opened this issue Apr 30, 2024 · 2 comments

Comments

@razzeee
Copy link
Contributor

razzeee commented Apr 30, 2024

Hey matthias, hope you're doing good.

With the flathub page, we're using a lot of icons and screenshots, and it would be nice to use next-gen formats.

For e.g. lighthouse test suite from google complains like this:

image

So it would be neat, to be able to generate those in addition to the "old" formats.

Cheers

@ximion
Copy link
Owner

ximion commented Apr 30, 2024

This is tricky, because more formats mean more complexity and we can only have one - so all frontends need to support the format first.

I actually played around with this for a while, and jpeg-xl (jxl) yielded by far the best quality/size ratio for the kind of data we produce (it could save about 4MB for Debian's icon tarball, which is huge!). It's pretty much on-par with png, while being vastly smaller.
So, I really would like to use it for both icons and well as screenshots (expanding the Freedesktop icon-theme spec in the process ideally, to just allow it globally). It being suitable for both icons (lossless) and screenshots (lossy) would make it a no-brainer.

The problem though is that webbrowsers only support it as an experimental option, if at all. And that is super annoying. There is nothing better for icons, where we want good quality, and AVIF would be nice, but only for screenshots, as AVIF's lossless mode only yielded results on-par with PNG and I also had some odd artifacts (granted though, I tested this way more than a year ago, so I guess these issues might be fixed now).

As soon as something is added, it's hard to remove, which is why I am currently a bit hesitant. If browsers would support JXL, that would be the ideal outcome, but at the moment it really doesn't look like it... So at least for screenshots, we might want to look into AVIF at some point (or WebP, which has a bit broader compatibility).

@razzeee
Copy link
Contributor Author

razzeee commented Apr 30, 2024

Yeah, jpeg-xl is likely still to new for browsers https://caniuse.com/?search=jpegxl

I was wondering, why we can only have one, I guess you mean, cause the catalogue points at the images.

For the website, i wouldn't need that part, so it would already be helpful for us, if appstream could create other image formats for everything and we can set that in infra, so those images get placed too. Then I could just switch over the website, as we control the image/icon code right now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants