Strip and lossless

Javi said on 05/29/2018


If I use -strip=3 with -lossless it does not strip the EXIF data, is this the expected behaviour?

For example:


Cédric Louvrier said on 05/30/2018

is this the expected behaviour

it is. the -lossless switch [edit: can not be use with -strip. also, pingo does not support interlaced or 16 bits/sample PNG]. it should be used only in some cases — e.g. if you plan to use PNG as heightmap or no auto-rotation for JPG. i suggest you do not use this for Web

Richard said on 06/08/2018


First of all - thank you for a great *fast* PNG compressor!

I just noticed that lossless mode does not appear to be truly lossless.

The following image has a single pixel in the top left that has a black color and an alpha value of 6.


Running it through pingo, even with -lossless, that alpha value is stripped to zero.

This does not happen in all cases. I initially wanted to make a demonstration image using a gradiented alpha, but that did not exhibit the issue. I tried adding some things to the image above, but the issue persisted... so I'm entirely unsure what the conditions are that trigger it.

If you need further information, or if I'm doing it wrong, please do let me know.

Thank you!

Cédric Louvrier said on 06/09/2018

using last pingo's release, -sN or -lossless should give the same result


the optimized PNG is paletted with 2 entries: one with alpha to 0 and another which has alpha to 6. this transformation is conform and lossless

Richard said on 06/10/2018

Thank you cédric,

After careful review it looks like your tool may not have been at fault; The GIMP seems not to recognize the two palette entries (or consolidates them to one), but I did verify there are two using other utilities. My apologies for wasting any of your time. I did download 0.97f just in case.

~ Richard

Javi said on 01/13/2019


There is a problem with the -lossless param processing PNGs: it transforms 16 bits RGB and grayscale images to 8 bits, and it changes the color table of indexed images (in this case I guess it is just optimizing the palette changing the order of the color table and it deletes several color entries not used, but I'm not sure (?)).

Pingo (0.98.48)

Cédric Louvrier said on 01/15/2018

it transforms 16 bits (...) to 8 bits

yes, it has some limitations. pingo does not write 16 bits/sample or interlaced PNG

it is just optimizing the palette

yes it is

comment this