optimization and compression

C├ędric Louvrier said on 09/25/2017

you may notice a difference between optimization and compression levels in pingo. this:

pingo -pngfilter image.png
pingo -s8 image.png

is actually a bit different from that:

pingo -pngfilter -s8 image.png

lossy filter, then full -s8 profile processing

pingo -pngfilter image.png
pingo -s8 image.png

there are two commands here: it orders pingo to apply the lossy filtering on the image, including all the step behind the scene: decoding, applying the lossy filtering and RGB transformations when alpha is 0, and finally encoding the image

original pingo -pngfilter + pingo -s8
76,6 KB 55,3 KB

then, the image is reloaded again and passed throught the -s8 profile, including again some steps: decoding, testing all reductions and encode the image with high compression

lossy filter with high compression

pingo -pngfilter -s8 image.png

this will not provide the same result: -s8 is not considered as a profile in this command, but as a compression level. that means pingo will not do any reductions on this image: it will just apply more compression, that let it to be much faster while providing very close or best result

original pingo -pngfilter -s8
76,6 KB 55,2 KB

note that the filesize difference could come from filtering and from what is done to RGB values: there is no absolute solution here, sometimes one way could offer more compression than the other. however, the processing time should be better


command pingo -pngfilter + pingo -s8 (second pass) pingo -pngfilter -s8
speed 1,84s (0,17 + 1,67) 0,91s (2x faster)
filesize 55,3 KB 55,2 KB

comment this