I am trying to get the best possible setting for png compression.
I found several plugins available here for imagemin: https://www.npmjs.com/browse/keyword/imageminplugin
I tried all the PNG options, but the compression speed looks pretty bad.
pngquant seems to have the highest compression ratio (which is obviously the worst quality), similar to the quality for tinypng, but it can still come close to the ting figure.
Essentially, I have 3 questions:
Question 1: Changing the options for advpng and optipng doesn't seem to change the file size, here is an example, am I using this correctly? I assume that maybe he is not using my settings at all and is not returning to the default settings? If you notice that the files of these two are identical !:
.pipe(imagemin( imageminOptipng({ optimizationLevel: 4 }) ))
Question 2: Am I using "pngout" correctly? Is there a way to use it that I don't know about? The examples from their page do not seem to work, and this method does not work:
.pipe(imagemin([ imageminPngout({ strategy: 1 }) ]))
Question 3: Is there a better way to handle png compression that I haven't found yet? Ideally, I would like to somehow get a method that has pngquant speed, but the quality is a little better.
source share