convert image data to paletted (256 colors max) (PNG)

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

pingo could pre-process the image data from PNG to reduce the number of colors to 256 (maximum). this lossy transformation could be very effective regarding the filesize but could have some limitations regarding the visual perception

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

paletted encoding

original file: tweet-book-write.png (50.69 KB): PNG image data to paletted
original pingo -pngpalette=100
tweet book write - original tweet book write - pngpalette
50.69 KB — 15804 colors 15.78 KB (0.14s) — 256 colors
dssim — butteraugli 0.00050033 — 2.769763

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 -pngpalette -sN target