Kagami / go-avif

:art: Go AVIF library
Creative Commons Zero v1.0 Universal
314 stars 22 forks source link

Cannot convert from big .png images ! #9

Open lululock71 opened 4 years ago

lululock71 commented 4 years ago

Hi, I'd like to use go-avif to convert large spritesheets for a project. But I've encountered a issue with the biggest files, some over 10MB. I already minified it as best as I could but I can't go lower. When I try to use go-avif (using the given Linux executable) on those pictures, I get : encoder error: codec init error

I noticed that the conversion process uses a hell lot of RAM, I thought it might be a issue because I have 16GB of RAM and almost 8GB (only for the conversion process, not counting what the rest of the system uses) were used when converting a 6MB png file. Then I realized this shouldn't be a issue since I have a swap partition for that kind of case...

Or maybe I didn't get something.

Details: ArchLinux x86-64 (5.4.30-1 LTS) 16GB RAM (+16GB SSD swap partition) Ryzen 2400G (4C/8T @ 3.60GHz)

grzegorz-janoszka commented 3 years ago

Hi, I have noticed the same - even 300kB JPG can take up to 2GB of RAM during conversion. That is a very good software but extremely memory hungry. Many web servers (where such conversion might take place) don't have 16 GB of RAM, but are rather small VPS with 1-2 GB RAM.