0

I am using pngquant for image compression with gulp. I have an asset folder with lots of png images. The most images have arround 100kb file size, but there are about two or three images with a file size of about 2MB.

when i start my gulp task using pnquant, every image is compressed immediately apart from the bigger ones. It takes like 10 minutes to compress them completely. Is this normal?

I know that it's okay for bigger files to take longer to compress, but this is just too much, even for that file size.

Marten Zander
  • 2,385
  • 3
  • 17
  • 32
  • It can take a while, it does some serious work. You can adjust the speed with a command line option, loses some quality. – harold Jan 26 '16 at 11:31
  • I'm not certain which exact algorithm pngquant uses, but there are some algorithms of that type which scale up very poorly (e.g. by doing tasks which require checking each pixel against every other pixel). However there's also the possibility that you're just too low on RAM for the larger images and all of the buffers, so check that first. – PeteB Jan 26 '16 at 11:34
  • quantization speed is usually defined by the distinct colors count and their grouping not by the image resolution itself so there may be something wrong like PeteB mentioned low RAM or small preallocated table/buffer sizes. – Spektre Jan 26 '16 at 16:21

0 Answers0