pingo examples

cédric (dev) said on 03/02/2018

important

always do backup before using pingo. try on test files/folders especially made for this. understand that this tool is processing all files in subfolders. it could convert/reduce the visual quality of your files and overwrite them without any backup or warning

targetsoptions (combinations) — demonstrations:

auto: optimize for Web auto: high quality (bigger filesize) auto: less quality (lower filesize)
force: lossy filtering force: lossy palletization force: remove transparency

targets

:: process file.png
pingo <options> file.png
:: process all PNG in the current directory
pingo <options> *.png
:: process all PNG/JPG in myfolder, including subfolders
pingo <options> myfolder
:: process all PNG/JPG in mysubfolder1, including subfolders
pingo <options> c:\myfolder\mysubfolder1
:: process all PNG/JPG in mysubfolder1 (avoid subfolders)
pingo <options> c:\myfolder\mysubfolder1\*.png *.jpg
:: process all PNG/JPG in myfolder and otherone (including subfolders)
pingo <options> c:\myfolder d:\otherone
:: process all PNG/JPG in myfolder (including subfolders)
pingo <options> \\server\folder\myfolder
:: process all PNG in myfolder (avoid subfolders, avoid JPG)
pingo <options> \\192.168.1.2\myfolder\*.png

options

lossless (web)

:: visually lossless profiles (lossless for Web usage)
pingo -s0 <targets>

lossless (pure)

:: shortcut for lossless options
pingo -lossless <targets>
pingo -s0 -noalpha -nodate -nojpgscale -norotation -nostrip <targets> :: same process

lossy (PNG)

:: auto (can convert PNG to JPG, choose lossy type automatically, adjust all parameters)
pingo <targets>
pingo -auto <targets> :: same process
:: auto (set quality for PNG and JPG)
pingo -auto=85 <targets>

see also: what does the default do?

:: set specific quality for PNG (avoid JPG conversion, choose lossy type automatically)
pingo -pngquality=85 <targets>
:: set specific lossy type/quality for PNG (lossy filter)
pingo -pngfilter=85 <targets>

see also: PNG: lossy implementation or lossy filter improvements

:: set specific lossy type/quality for PNG (palletization)
pingo -pngpalette=85 <targets>
:: set specific lossy type/quality for PNG (color reduction)
pingo -pngcolor=85 <targets>

do not combine -pngquality, -pngfilter, -pngpalette or -pngcolor in a same command

lossy (JPG)

:: set JPG quality
pingo -jpgquality=85 <targets>
:: set JPG subsampling
pingo -jpgsample=0 <targets>
:: set JPG quantization table
pingo -jpgtable=0 <targets>

lossy (conversion PNG <=> JPG)

:: convert RGB data for a solid background color, remove transparency and convert to JPG
pingo -jpgconvert <targets>
:: convert JPG to PNG with filter and paletted encoding (for simple graphics only)
pingo -pngconvert=4 -pngpalette=30 <targets>

see also: pngconvert

transformations (lossy)

:: auto (convert RGB data for a solid background color, remove transparency, could convert to JPG)
pingo -notrans <targets>
:: remove transparency with no additional lossy
pingo -notrans -s0 <targets>

see also: remove transparency

:: auto (convert RGB data to grey levels, could convert to PNG)
pingo -grayscale <targets>
:: convert RGB data to grey levels with no additional lossy
pingo -grayscale -s0 <targets>

see also: grayscale

fast modes (lossy)

:: remove all chunks/markers, do not optimize
pingo -fast <targets>

see also: -fast and -nostrip

trials (lossy)

:: uncompress the PNG datastream
pingo -u <targets>
:: optimize but do not compress the PNG datastream
pingo -s8 -nc <targets>

see also: uncompressed PNG datastream

combinations

as you could see, some options can be combined like this, whatever the order:

:: good command
pingo -s1 -pngquality=50 <targets>
pingo -pngquality=50 -s1 <targets> :: same process
:: good command
pingo -s4 -grayscale -pngpalette=50 <targets>
pingo -pngpalette=50 -grayscale -s4 <targets> :: same process

however, an option should *NOT* be combined with another which performs a different transformation. in this case, pingo considers all options but selects only one among those which can not be combined *

:: bad command
pingo -s1 -pngpalette -pngquality=50 <targets> :: what you asked
pingo -s1 -pngpalette -pngquality=50 <targets> :: what is done

in this example:

  • -pngpalette forces pingo to use palletization
  • -pngquality=50 is pick automatically lossy with this quality factor

as this command asks two different things, pingo will ignore the -pngpalette switch. another examples:

:: bad command
pingo -s1 -pngcolor -pngpalette <targets> :: what you asked
pingo -s1 -pngcolor -pngpalette <targets> :: what is done
:: bad command
pingo -pngfilter=10 -lossless -grayscale -s4 <targets> :: what you asked
pingo -pngfilter=10 -lossless -grayscale -s4 <targets> :: what is done

* if you did a bad command, pingo should select the option that offers the less loss or should return bad command

demonstrations

originals

originals
input 1: PNG (RGBA) input 2: PNG (RGBA) input 3: PNG (RGB)
13,29 KB 76,91 KB 67,68 KB

auto: optimize for Web

pingo -auto *.png
output 1: PNG (paletted) output 2: PNG (RGBA) output 3: JPG (RGB)
8,26 KB 51,64 KB 16,08 KB

auto: high quality

pingo -auto -pngquality=100 -jpgquality=96 *.png
output 1: PNG (paletted) output 2: PNG (RGBA) output 3: JPG (RGB)
8,26 KB 67,71 KB 30,25 KB

auto: less quality

pingo -auto -pngquality=10 -jpgquality=85 *.png
output 1: PNG (paletted) output 2: PNG (RGBA) output 3: JPG (RGB)
8,26 KB 39,77 KB 14,94 KB

force: lossy filtering

pingo -pngfilter=90 *.png
output 1: PNG (RGBA) output 2: PNG (RGBA) output 3: PNG (RGB)
13,29 KB 66,02 KB 56,97 KB
pingo -pngfilter=1 *.png
output 1: PNG (RGBA) output 2: PNG (RGBA) output 3: PNG (RGB)
13,29 KB 38,18 KB 26,66 KB

force: palletization

pingo -pngpalette *.png
output 1: PNG (paletted) output 2: PNG (paletted) output 3: PNG (paletted)
8,69 KB 23,07 KB 24,23 KB

force: no transparency

pingo -auto -notrans *.png
output 1: PNG (paletted) output 2: JPG (RGB) output 3: JPG (RGB)
7,78 KB 18,59 KB 16,08 KB
pingo -auto -notrans -rgb: 128 164 164 *.png
output 1: PNG (paletted) output 2: JPG (RGB) output 3: JPG (RGB) *
7,47 KB 17,86 KB 16,08 KB

* pingo needs RGBA/tRNS data to change the background color

pingo -s0 -notrans *.png
output 1: PNG (RGB) output 1: PNG (RGB) output 1: PNG (RGB)
12,91 KB 68,17 KB 67,68 KB

PNG to JPG conversion

pingo -jpgconvert *.png
output 1: JPG (RGB) output 1: JPG (RGB) output 1: JPG (RGB)
8,65 KB 18,59 KB 16,08 KB