image optimizer for web

lossless settings produce lossy output for some inputs

Ken said, on 27/09/2021
I ran pingo with the setting -s9 on a collection of pngs, some alpha, some not. While the results were overall good, some of the output files were not pixel-for-pixel duplicates of the originals. The visual differences were only minor, but were observable to the human eye. These settings are labeled as 'lossless' on your documentation, so I was expecting it would only overwrite and claim savings if the result was indistinguishable.

I might suggest a -lossless param that would request pingo only perform lossless transformations, and ensure that the output is a pixel-for-pixel match of the input before overwriting. 
dwc said, on 27/09/2021
What were the options you were using?
Just `-s9` or was there anything else?
Ken said, on 28/09/2021
Sorry, this was user error. I was relying a another program to diff images for me, and it failed in two edge cases:

One was where A=0 pixels were stripped by your program. This created 'differences' between the images, but also visible differences that I saw along the edges because some image viewers render them differently (due to blending or stretching pixels at different zoom levels). Not a bug.

The other was where your program reduced the bit depth from 32bppArgb to 24bppRgb... on images that were purely solid with no alpha. This was also registered as a 'difference' even though I couldn't see any visible difference. It took me longer than I'd like to admit to realize this was the cause of the 'differences'. Also not a bug.

Sorry for the confusion.

reply