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

Add New File Format Support: AVIF #431

Open
Grandsome opened this issue Mar 2, 2023 · 3 comments
Open

Add New File Format Support: AVIF #431

Grandsome opened this issue Mar 2, 2023 · 3 comments

Comments

@Grandsome
Copy link

Is your feature request related to a problem? Please describe.
Add support for the AVIF file format, it has a comparable compression ratio to WebP, but less destructive when it comes to image quality. Currently, using WebP with the program, it works well most of the time, but sometimes the loss of quality is very noticeable, this happens far less often with AVIF, especially since most portrait source are already compressed, and we're compressing the image at least twice. I'm a bit loss of information averse.

Describe the solution you'd like
I'm not sure which encoder library you guys use, but the official AVIF one is here, but FFmpeg and SAIL also support it.

Describe alternatives you've considered
Currently, using WebP, it works well most of the time, but sometimes the loss of quality is very noticeable. Could still use JPEG, but I'm not sure if TokenTool can just crop a file losslessly if the output format is the same as the input one.

Additional context
Current browser support 83%.

@Azhrei
Copy link
Member

Azhrei commented Mar 2, 2023

I did some searching but couldn't find a Java language binding for the libheif library, which means MapTool won't be able to use it.

(Also, the README for the Git repo also says the API isn't stable yet. That's not a huge problem for MapTool since any Java lib would have to abide by the Image SPI anyway, but it means there's likely to be a lot of updates to the Java lib in the near-term for anyone who takes on supporting it.)

@thelsing
Copy link

thelsing commented Mar 2, 2023

Might be possible to use https://github.com/lanthale/libheiffx and convert it with SwingFXUtils.

@Azhrei
Copy link
Member

Azhrei commented Mar 3, 2023

That library seems pretty risky to me (in terms of technical debt), and without much payback. Once the renderer is redone using JFX, then animation can be supported and AVIF makes a little more sense (given that animations can be significantly smaller than they are in WebP).

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

No branches or pull requests

3 participants