kornelski / pngquant

Lossy PNG compressor — pngquant command based on libimagequant library
https://pngquant.org
Other
5.25k stars 487 forks source link

Is it possible to limit memory consumption? #343

Closed z0mb1ek closed 5 years ago

z0mb1ek commented 5 years ago

Hi. I get exit code 15 when memory is not enough. ImageMagick has -limit param for example

kornelski commented 5 years ago

Yes, there is a limit functionality:

https://github.com/ImageOptim/libimagequant/blob/3e46d777f8ca7e840d4b2829f19f0d855bfedb5e/libimagequant.c#L39

Note that by default it's set to 64MB of memory + size of decoded RGBA image. So either image you're working on is larger than your memory, or there's something very broken with your setup if 64MB is too much.