what does the default do?

cédric (dev) said on 09/22/2017

pingo has a default option which does optimization for Web: it picks all settings by itself, including if it will be lossless, visually lossless or lossy (type/levels). this default is also used via the contextual menu (Send To)

pingo image.png

adaptive mode

now consider those following transparent images and let's see what happens

flat design more colors/shadow complex structure
17,0 KB 67,3 KB 95,9 KB

flat, simple structure

if pingo could guess that an image is using a simple structure, like flat design, it will probably convert the image to paletted encoding. in this case, it decreases the number of color below 257 — it sets the number of colors by detecting image specifications

original pingo (auto): conversion to paletted
17,0 KB 9,16 KB

more colors/shadow

the paletted conversion is an efficient way to decrease filesize, but could meet some limitations about quality. if pingo detects some factors (more colors, shadows etc.), it will use the lossy filtering instead and choose lossy levels automatically

original pingo (auto): lossy filtering
67,3 KB 44,8 KB

complex structure

those kind of images are usually better stored as JPG if they do not have transparency, and using lossy filtering if they have. however, some of them have less sensible area: in this case, pingo could choose to pick paletted instead. on this specific sample, it tries to optimize the order of entries in the palette after the quantization

original pingo (auto): paletted + sort
95,9 KB 31,4 KB

JPG conversion

if an image has complex structure (like pictures) pingo could choose to convert it to JPG. it could do this conversion if there is no transparency — if the image have an alpha channel, it checks if it is really used

original (PNG: unused alpha channel) pingo (auto): JPG
77,5 KB 16,9 KB

want specific quality if JPG conversion is used?

just set the quality you want. your value will be used if it decides to convert PNG to JPG or/and if it finds other JPG files to optimize:

pingo -quality=93 myfolder

do not want JPG conversion?

just disable it: pingo will choose another solution by itself

pingo -noconversion myfolder

more controls

  • it is not 100% accurate and could do bad choices. its detection set is quite naive and it considers speed more than result. you should have to do some checks yourself
  • if you want more controls about quality, you could use -auto=N. if you want to force a specific lossy, you could use -pngfilter, -pngcolor or -pngpalette

cédric (dev) said on 07/06/2018

0.97.2 should be more efficient when taking some decisions. it should do better handling of (potentially) small files and uncompressed input, but is a bit slower in some cases

auto
original file: 18-filtering.png
tool choice output
0.97.1 JPG conversion 5 504 bytes
0.97.2 lossless optimization 758 bytes
original file: pajarito1.png
tool choice output
0.97.1 lossy filter 61 862 bytes
0.97.2 lossy paletted 24 339 bytes

it is still far away from perfection and can be easily fooled — it is just a bit more accurate. (edit 07/12/2018) in 0.97.4, this trial is even more accurate. note: this can be disabled by using -nocheck

comment this