lossy filter improvements

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

pingo 0.91 has an improved implementation of the lossy filtering process:

pingo v0.89
-pngfilter=N    (0-3) set quality

pingo 0.89 was deliberately limited to four levels

pingo v0.90
-pngfilter=N    (1-100) set quality for lossyfilter

while pingo 0.91 has more range

implemented comparison

let's compare a sample (strawberry) from the overview of the new lossy filter improvements

pingo command dssim butteraugli filesize
pingo 0.91 -s8 -pngfilter=100 0.00005533 0.697268 198 KB
pingo 0.89 -s8 -pngfilter=0 0.00005671 1.253747 193 KB
pingo 0.91 -s8 -pngfilter=90 0.00016418 1.087225 154 KB
pingo 0.89 -s8 -pngfilter=1 0.00016615 1.835107 147 KB
pingo 0.91 -s8 -pngfilter=70 0.00028917 1.319446 132 KB
pingo 0.89 -s8 -pngfilter=2 0.00029509 2.290854 124 KB
pingo 0.91 -s8 -pngfilter=50 (img) 0.00049486 1.672756 116 KB
pingo 0.89 -s8 -pngfilter=3 (img) 0.00050266 2.814435 107 KB

if you trust dssim on this sample there is only a bit improvement from 0.89 to 0.91: it gives a bit better score while filesize is bigger. however, there are huge differences with butteraugli evaluations

human comparison

i decided to trust my eyes to set pingo 0.91. it seems they could be particularly more sensible to this variation:

enhanced details of pingo 0.89 lossy filter (-pngfilter=3)

enhanced details of 0.91 lossy filter (-pngfilter=50)

(further) comparison

i locked pingo 0.89 to level 3 because the old implementation will decrease image quality too much. let's see what happens if i did go further (same as new one):

enhanced details of pingo 0.89 lossy filter without limitations (to the same level as the new)

enhanced details of pingo 0.91 lossy filter (-pngfilter=10)

pingo 0.89 -s8 -pngfilter (without limitations) (img) 0.00156013 5.128576 77.1 KB
pingo 0.91 -s8 -pngfilter=10 (img) 0.00153199 2.868826 86.5 KB

global note

pingo 0.91 is not especially targeting any metrics and could adapt the lossy value (more or less) according to file specifications. on the samples from the lossy filtering implementation overview

example penality notes
apple.png none -
strawberry.png bonus all values have more quality: 100-91 range is same; same goes for 90-71
date.png malus all values have less quality; less quality limitation: 20

in most of case, the new 0.91 could offer better quality but bigger filesize. however, since it has less limitations, it could go further on the lossy compression

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

pingo 0.95q and other lossy filter implementation

low

apple.png (204 111 bytes)
TruePNG 0.6.2.5 dssim butteraugli (old) butteraugli (new) timer filesize
-o4 -l q=8 0.01066764 3.422260 4.887904 16.53s 79 664 bytes
-f3 -l q=8 0.01066420 3.421980 4.895116 1.57s 74 526 bytes
MCut Posterizer f5f6765 dssim butteraugli (old) butteraugli (new) timer filesize
-d -b -q 85 0.00087240 2.996570 4.378068 0.44s 71 909 bytes
pingo 0.95q dssim butteraugli (old) butteraugli (new) timer filesize
-pngfilter=30 -s1 0.00081575 2.026016 3.135693 0.32s 65 813 bytes
apricot.png (266 606 bytes)
TruePNG 0.6.2.5 dssim butteraugli (old) butteraugli (new) timer filesize
-o4 -l q=8 0.00526412 3.408901 5.174392 38.58s 100 351 bytes
-f3 -l q=8 0.00525357 3.409925 5.170077 2.17s 98 663 bytes
MCut Posterizer f5f6765 dssim butteraugli (old) butteraugli (new) timer filesize
-d -b -q 85 0.00131842 2.711033 3.272612 0.67s 94 940 bytes
pingo 0.95q dssim butteraugli (old) butteraugli (new) timer filesize
-pngfilter=30 -s1 0.00134337 2.045445 2.578441 0.39s 93 749 bytes
banana.png (80 741 bytes)
TruePNG 0.6.2.5 dssim butteraugli (old) butteraugli (new) timer filesize
-o4 -l q=8 0.00076118 4.721854 6.525383 12.35s 37 247 bytes
-f3 -l q=8 0.00075104 4.990517 6.362400 0.92s 35 766 bytes
MCut Posterizer f5f6765 dssim butteraugli (old) butteraugli (new) timer filesize
-d -b -q 85 0.00037624 2.809581 3.806244 0.20s 35 163 bytes
pingo 0.95q dssim butteraugli (old) butteraugli (new) timer filesize
-pngfilter=30 -s1 0.00036595 2.216316 2.961089 0.18s 32 022 bytes

lower

cherry.png (137 925 bytes)
TruePNG 0.6.2.5 dssim butteraugli (old) butteraugli (new) timer filesize
-o4 -l q=10 0.01617531 4.955483 7.567052 20.70s 58 876 bytes
-f3 -l q=10 0.01604685 4.903528 7.469898 1.08s 57 895 bytes
MCut Posterizer f5f6765 dssim butteraugli (old) butteraugli (new) timer filesize
-d -b -q 80 0.00095896 3.720111 4.467595 0.39s 64 600 bytes
pingo 0.95q dssim butteraugli (old) butteraugli (new) timer filesize
-pngfilter=10 -s1 0.00087274 3.257375 4.464509 0.26s 58 616 bytes
kiwi.png (358 375 bytes)
TruePNG 0.6.2.5 dssim butteraugli (old) butteraugli (new) timer filesize
-o4 -l q=10 0.01730124 6.597872 9.272667 33.34s 123 928 bytes
-f3 -l q=10 0.01699841 6.339300 9.133118 1.88s 129 004 bytes
MCut Posterizer f5f6765 dssim butteraugli (old) butteraugli (new) timer filesize
-d -b -q 80 0.00301125 4.122328 5.145789 0.80s 119 295 bytes
pingo 0.95q dssim butteraugli (old) butteraugli (new) timer filesize
-pngfilter=10 -s1 0.00295477 3.724677 3.142940 0.46s 115 920 bytes

very low

peach.png (197 896 bytes)
TruePNG 0.6.2.5 dssim butteraugli (old) butteraugli (new) timer filesize
-o4 -l q=14 0.01518452 5.755095 10.026107 28.44s 55 502 bytes
-f3 -l q=14 0.01514743 5.805070 9.981814 1.31s 54 260 bytes
MCut Posterizer f5f6765 dssim butteraugli (old) butteraugli (new) timer filesize
-d -b -q 79 0.00213067 4.455790 7.283230 0.33s 50 906 bytes
pingo 0.95q dssim butteraugli (old) butteraugli (new) timer filesize
-pngfilter=1 -s1 0.00202700 4.157181 4.707268 0.33s 50 463 bytes
strawberry.png (284 453 bytes)
TruePNG 0.6.2.5 dssim butteraugli (old) butteraugli (new) timer filesize
-o4 -l q=14 0.01453755 4.621344 6.656554 31.98s 94 512 bytes
-f3 -l q=14 0.01455172 4.525638 6.651154 1.83s 91 893 bytes
MCut Posterizer f5f6765 dssim butteraugli (old) butteraugli (new) timer filesize
-d -b -q 79 0.00157172 4.348324 6.232947 0.62s 91 331 bytes
pingo 0.95q dssim butteraugli (old) butteraugli (new) timer filesize
-pngfilter=1 -s1 0.00153259 2.868623 3.870983 0.42s 87 471 bytes

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

pingo 0.95q and olders

low and higher compression

apple.png (204 111 bytes)
version dssim butteraugli (old) butteraugli (new) filesize
pingo 0.93 0.00167222 4.569569 3.012189 49 095 bytes
pingo 0.94 0.00139755 5.033953 3.658291 51 587 bytes
pingo 0.95q 0.00167222 4.569569 3.012189 49 030 bytes
apricot.png (266 606 bytes)
version dssim butteraugli (old) butteraugli (new) filesize
pingo 0.93 0.00258734 3.832145 3.135945 66 335 bytes
pingo 0.94 0.00230319 4.192172 3.252568 68 971 bytes
pingo 0.95q 0.00258734 3.832145 3.135945 66 237 bytes
banana.png (80 741 bytes)
version dssim butteraugli (old) butteraugli (new) filesize
pingo 0.93 0.00077158 4.775553 3.266617 25 194 bytes
pingo 0.94 0.00063717 6.140975 4.468627 25 120 bytes
pingo 0.95q 0.00077158 4.775553 3.266617 24 970 bytes
cherry.png (137 925 bytes)
version dssim butteraugli (old) butteraugli (new) filesize
pingo 0.93 0.00106332 4.855742 3.570708 52 988 bytes
pingo 0.94 0.00091453 4.467742 3.374222 52 347 bytes
pingo 0.95q 0.00106332 4.855742 3.570708 52 549 bytes
kiwi.png (358 375 bytes)
version dssim butteraugli (old) butteraugli (new) filesize
pingo 0.93 0.00365031 3.633487 4.215998 107 081 bytes
pingo 0.94 0.00242060 4.163463 3.362962 112 597 bytes
pingo 0.95q 0.00365371 3.633477 4.215998 104 876 bytes
lemon.png (260 222 bytes)
version dssim butteraugli (old) butteraugli (new) filesize
pingo 0.93 0.00194264 3.787156 2.978336 86 183 bytes
pingo 0.94 0.00155995 4.562962 3.594189 97 147 bytes
pingo 0.95q 0.00194575 3.787516 2.978355 85 172 bytes
mango.png (125 565 bytes)
version dssim butteraugli (old) butteraugli (new) filesize
pingo 0.93 0.00126514 3.629132 3.222392 31 892 bytes
pingo 0.94 0.00112527 4.561251 3.347608 32 587 bytes
pingo 0.95q 0.00126514 3.629132 3.222392 31 633 bytes
orange.png (278 241 bytes)
version dssim butteraugli (old) butteraugli (new) filesize
pingo 0.93 0.00294546 3.409539 3.351089 61 870 bytes
pingo 0.94 0.00227837 4.135450 2.946610 76 913 bytes
pingo 0.95q 0.00294684 3.409815 3.198772 60 084 bytes
peach.png (197 896 bytes)
version dssim butteraugli (old) butteraugli (new) filesize
pingo 0.93 0.00202700 4.707268 4.157235 46 081 bytes
pingo 0.94 0.00176607 5.020861 3.764784 41 655 bytes
pingo 0.95q 0.00202700 4.707268 4.157235 46 021 bytes
pear.png (178 789 bytes)
version dssim butteraugli (old) butteraugli (new) filesize
pingo 0.93 0.00190659 4.700196 3.316683 35 282 bytes
pingo 0.94 0.00158164 5.327400 3.694429 41 655 bytes
pingo 0.95q 0.00190659 4.700196 3.316683 35 275 bytes
strawberry.png (178 789 bytes)
version dssim butteraugli (old) butteraugli (new) filesize
pingo 0.93 0.00153199 3.526735 2.868826 88 667 bytes
pingo 0.94 0.00107682 4.437146 3.020862 85 050 bytes
pingo 0.95q 0.00153259 3.870983 2.868620 84 810 bytes
tomato.png (201 410 bytes)
version dssim butteraugli (old) butteraugli (new) filesize
pingo 0.93 0.00145866 5.757054 4.210948 49 530 bytes
pingo 0.94 0.00123121 4.275247 3.264013 50 184 bytes
pingo 0.95q 0.00145866 5.757054 4.210948 49 547 bytes

summary

-pngfilter=1-s8 (32-bit)

12 files - G1820 @ 2.7 Ghz - 2 Go RAM - Windows 7 32-bit
version timer (lower = better) butteraugli new (lower = better) savings (higher = better)
pingo 0.93 18.21s 41,306966 1 874 136 bytes
pingo 0.94 13.60s 41,749165 1 834 694 bytes
pingo 0.95q 14.62s 41,154462 1 884 130 bytes

-pngfilter=1-s0 (32-bit)

12 files - G1820 @ 2.7 Ghz - 2 Go RAM - Windows 7 32-bit
version timer (lower = better) butteraugli new (lower = better) savings (higher = better)
pingo 0.93 1.77s 41,306966 1 807 513 bytes
pingo 0.94 1.66s 41,749165 1 769 442 bytes
pingo 0.95q 1.50s 41,154462 1 816 806 bytes

comment this