Open varnav opened 5 years ago
Agreed, this makes total sense
Hi, any info when it will be developed???
@varnav say:
--skip-if-larger must be default setting
So put it on.
to:
int opt;
options->skip_if_larger = true;
...
case arg_skip_larger:
options->skip_if_larger = !(options->skip_if_larger);
break;
The problem is that pngquant is supposed to generate a new file. If it sometimes didn't generate a new file, it'd be super weird. People would complain to me that the tool sometimes "doesn't work".
@kornelski It seems that your image compression algorithm needs to be improved to reduce the number of newly created files that are larger than the original files.
How can they create PNG files smaller than files compressed with pngquant? Have you ever thought about that when reading this issue?
@shinsenter say:
It seems that your image compression algorithm
https://github.com/kornelski/pngquant/blob/7ffdc41525d80461d1f581644fbf9df135140c67/pngquant.c#L57
There is no algorithm in this repository. It is in a completely different place: https://github.com/ImageOptim/libimagequant
@kornelski Looks like I got it wrong? I was just wondering about failed compression ratio in the issue.
The libimagequant library was also participated by you, right?
Yes, libimagequant part of the pngquant project. It does 99% of the work.
Why don't copy original PNG to a "converted" copy if the size of converted image is larger than original? It will not break existing behavior, pngquant will always create a new file. On the other hand, there will be no confusion, when optimized PNG is larger than original one.
I was quite surprised that after running program for image optimization with defaults I ended up with 30% of smaller images and 70% of larger images, and with bigger total.
--skip-if-larger must be default setting