Add support for AVIF
Moderator: ickputzdirwech
Add support for AVIF
please allow the game to use avif its much more efficient and smaller.
my mod folder is taking up 4gb of png files this can be reduced by 70% with avif.
there are batch apps to convert all png to avif lossless
my mod folder is taking up 4gb of png files this can be reduced by 70% with avif.
there are batch apps to convert all png to avif lossless
Re: Add support for AVIF
Doesn’t make much sense, because it needs to be unpacked when loading, which takes up some more time. Then it seems to be a non-loseless kind of compression which is bad , because in Factorio every pixel counts. And unpacked into memory the images have the same size, because that’s what’s done to make the graphics fast... I would mean the prize for 3 GB on your hard disk is much cheaper, than these disadvantages.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Re: Add support for AVIF
4gb of disk space is a problem? it is not 1998
-
- Long Handed Inserter
- Posts: 69
- Joined: Tue Apr 17, 2018 11:45 pm
- Contact:
Re: Add support for AVIF
Avif sucks hard for lossless compression.
See https://jakearchibald.com/2020/avif-has-landed/ (-> flat illustration)
If that’s all true, then lossless WebP seems to perform better. But for these 10-20% - I don’t know if that makes sense.
See https://jakearchibald.com/2020/avif-has-landed/ (-> flat illustration)
If that’s all true, then lossless WebP seems to perform better. But for these 10-20% - I don’t know if that makes sense.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Re: Add support for AVIF
generally the tradeoff is in the size vs performance. better compression is going to be slower both in decompression and compression. so, you'll sacrifice load times.ssilk wrote: ↑Wed May 05, 2021 2:15 am Avif sucks hard for lossless compression.
See https://jakearchibald.com/2020/avif-has-landed/ (-> flat illustration)
If that’s all true, then lossless WebP seems to perform better. But for these 10-20% - I don’t know if that makes sense.
overall a bad idea for no gains
-
- Fast Inserter
- Posts: 214
- Joined: Fri Oct 05, 2018 4:34 pm
- Contact:
Re: Add support for AVIF
There's more to it than just disk space, the mod portal currently has a maximum file size of 262.1 MB and we already see mod authors employing lossy PNG compression in order to make their mods fit into that file size limit. Supporting AVIF would enable mod authors to deliver higher quality sprites in less space than lossy PNG compression does.
Take for example the animated dish in Space Exploration, the original PNG sprite sheet (left) is 36 MB and compressed with pngquant to reduce the file size to 12 MB (middle), if AVIF was supported it could be used instead to compress it to 6 MB (right) while IMHO looking better than the pngquant output.
Notice how the reduced colour palette of the pngquant version causes very visible dithering in the top left shadow and the edges of the circuit wire. The AVIF compression does not have this issue and more colourful sprites would make the visual difference between pngquant and AVIF even greater.
Take for example the animated dish in Space Exploration, the original PNG sprite sheet (left) is 36 MB and compressed with pngquant to reduce the file size to 12 MB (middle), if AVIF was supported it could be used instead to compress it to 6 MB (right) while IMHO looking better than the pngquant output.
Notice how the reduced colour palette of the pngquant version causes very visible dithering in the top left shadow and the edges of the circuit wire. The AVIF compression does not have this issue and more colourful sprites would make the visual difference between pngquant and AVIF even greater.
-
- Smart Inserter
- Posts: 2768
- Joined: Tue Apr 25, 2017 2:01 pm
- Contact:
Re: Add support for AVIF
I honestly almost can't tell the difference without magnifying them even further, and considering they will be smaller than this even in normal gameplay, I'd say the concerns around load times and performance are more important (to me personally).Hornwitser wrote: ↑Wed Aug 17, 2022 9:36 pm There's more to it than just disk space, the mod portal currently has a maximum file size of 262.1 MB and we already see mod authors employing lossy PNG compression in order to make their mods fit into that file size limit. Supporting AVIF would enable mod authors to deliver higher quality sprites in less space than lossy PNG compression does.
Take for example the animated dish in Space Exploration, the original PNG sprite sheet (left) is 36 MB and compressed with pngquant to reduce the file size to 12 MB (middle), if AVIF was supported it could be used instead to compress it to 6 MB (right) while IMHO looking better than the pngquant output.
comp.png
Notice how the reduced colour palette of the pngquant version causes very visible dithering in the top left shadow and the edges of the circuit wire. The AVIF compression does not have this issue and more colourful sprites would make the visual difference between pngquant and AVIF even greater.
As for the mod portal, that's easy to solve: advocate for the size limit to be raised. 'Cause, yeah, disk space is cheap in comparison these days.
--------------------------------------
Edit: Just to add (for general purpose of the thread, not a direct reply to the quoted post above), while I am for increased quality of sprites and all, I am not for it if it impacts game performance. I do have and use some HD graphics mods. But if any mod I played used a graphics format that slowed down game loading/play significantly (such as using this AVIF format), I'd probably ask if they could release a version that doesn't use it (defeating the purpose, yes?), and if they declined, then I'd probably drop the mod. As it was, I was very close to dropping the HD graphics mods I used because of their impact on load time (which was all data stage script related) until the devs released that update that greatly sped up the process.
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles | New Gear Girl & HR Graphics
-
- Fast Inserter
- Posts: 214
- Joined: Fri Oct 05, 2018 4:34 pm
- Contact:
Re: Add support for AVIF
The file format makes no difference to the performance of the game. No matter the image format they will all be converted to the same RGB texture format when loaded on the GPU. Since you say disk space is of no concern and load times is everything then there's already a great solution for you: Turn on cache-sprite-atlas and have a couple of GB of disk space wasted to make the game load faster by caching the RGB textures that would be loaded onto the GPU uncompressed on your hard drive.FuryoftheStars wrote: ↑Wed Aug 17, 2022 11:28 pm I'd say the concerns around load times and performance are more important (to me personally).
As for the mod portal, that's easy to solve: advocate for the size limit to be raised. 'Cause, yeah, disk space is cheap in comparison these days.
-
- Smart Inserter
- Posts: 2768
- Joined: Tue Apr 25, 2017 2:01 pm
- Contact:
Re: Add support for AVIF
Ok, but they do affect load time. The AVIF format sounds like it would take longer for the game to load than png. Again, I already almost abandoned some other mods over their affect on the load time and that was over the data stage script, not the actual decompression/conversion of the images.Hornwitser wrote: ↑Thu Aug 18, 2022 1:44 pm The file format makes no difference to the performance of the game. No matter the image format they will all be converted to the same RGB texture format when loaded on the GPU.
To my last understanding, if anything changes, it dumps and reloads the whole set (and considering how often I'm changing things, that makes it near worthless for me) and is an experimental feature that is not 100% known to be stable or supported.Hornwitser wrote: ↑Thu Aug 18, 2022 1:44 pm Since you say disk space is of no concern and load times is everything then there's already a great solution for you: Turn on cache-sprite-atlas and have a couple of GB of disk space wasted to make the game load faster by caching the RGB textures that would be loaded onto the GPU uncompressed on your hard drive.
I did give it a try once upon a time, though. For me, it seemed to have a very minor impact. *shrug*
My Mods: Classic Factorio Basic Oil Processing | Sulfur Production from Oils | Wood to Oil Processing | Infinite Resources - Normal Yield | Tree Saplings (Redux) | Alien Biomes Tweaked | Restrictions on Artificial Tiles | New Gear Girl & HR Graphics
Re: Add support for AVIF
Can anyone point to a decoding benchmark?
I only found encoding and quality tests.
I only found encoding and quality tests.
-
- Fast Inserter
- Posts: 133
- Joined: Fri Mar 02, 2018 2:55 pm
- Contact:
Re: Add support for AVIF
Maybe JPEG XL will be better choice?
As fast as JPEG, but much more higher quality than other HD graphics formats (HEIF, AVIF etc).
Lossless compression, animation supprt and more...
https://jpegxl.info/
As fast as JPEG, but much more higher quality than other HD graphics formats (HEIF, AVIF etc).
Lossless compression, animation supprt and more...
https://jpegxl.info/
Re: Add support for AVIF
I was thinking it would be ironical if the devs Bloated Factorio with all these fancy new better image formats support and made Factorio heavier by tens or hundreds of megabytes for all the players, just to shave off a Gb from the mods folder for a handful of players who play with huge mod packs.
Koub - Please consider English is not my native language.