RPTools / TokenTool

TokenTool removes much of the tedium from creating tokens for use with MapTool or your favorite online gaming application. Just drag an image into the background, select a frame, zoom and pan to suit, and drag off a finished token. The resulting token is transparent around the edges and cropped to the size you wanted.
http://www.rptools.net/toolbox/token-tool/
GNU Affero General Public License v3.0
176 stars 43 forks source link

Add New File Format Support: AVIF #431

Open Grandsome opened 1 year ago

Grandsome commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

Azhrei commented 1 year ago

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).