lossy filtering (PNG)

last modified on 9 July 2019, by Cédric Louvrier

pingo could pre-process the image data from PNG using a lossy filtering. this lossy transformation could be more effective on RGBA samples which have lot of colors or complex structure

N: from 1 to 100 — 1: smaller filesize, worse quality — 100: bigger filesize, better quality
pingo -pngfilter=N target

lossy filtering

original file: strawberry.png (276.89 KB): PNG lossy filtering
original pingo -pngfilter=100 pingo -pngfilter=90
strawberry - original strawberry - pngfilter 100 strawberry - pngfilter 90
276.89 KB (0.37s) 201.49 KB (0.38s) 196.51 KB (0.36s)
dssim - butteraugli 0.00005546 — 0.668895 0.00005667 — 1.138962
pingo -pngfilter=80 pingo -pngfilter=70 pingo -pngfilter=60
strawberry - pngfilter 80 strawberry - pngfilter 70 strawberry - pngfilter 60
156.57 KB (0.37s) 153.08 KB (0.37s) 135.46 KB (0.39s)
0.00016367 — 0.946475 0.00016454 — 1.302280 0.00028643 — 1.263934
pingo -pngfilter=50 pingo -pngfilter=40 pingo -pngfilter=30
strawberry - pngfilter 50 strawberry - pngfilter 40 strawberry - pngfilter 30
131.55 KB (0.36s) 116.18 KB (0.37s) 106.3 KB (0.37s)
0.00028757 - 1.285094 0.00049214 - 1.720253 0.00068239 - 1.975763
pingo -pngfilter=20 pingo -pngfilter=10 pingo -pngfilter=1
strawberry - pngfilter 20 strawberry - pngfilter 10 strawberry - pngfilter 1
98.34 KB (0.37s) 92.69 KB (0.35s) 88.19 KB (0.37s)
0.00097761 - 2.380113 0.00122898 - 2.771119 0.00151770 - 3.148625

compression level

note that the lossless compression level over this transformation can be increased to get smaller filesize by using -sN

N: from 0 to 9 — 0: fast and good compression — 9: slow, but better compression
pingo -pngfilter -sN target