kornelski / pngquant

Lossy PNG compressor — pngquant command based on libimagequant library
https://pngquant.org
Other
5.25k stars 486 forks source link

Why RGB values on transparent pixels is (71,112,76) #362

Closed shanegxxiao closed 4 years ago

shanegxxiao commented 4 years ago

After compare several pairs images processed by pngquant, it seems pixel with rgba = (0, 0, 0, 0) was modified to (71, 112, 76, 0), How is it happen? It makes premultiply alpha works failed.

kornelski commented 4 years ago

No, it's not a failure. When alpha=0 these values have no meaning. They're visible only in software that incorrectly drops the alpha channel, and in that case they're useful for diagnosing the error.

shanegxxiao commented 4 years ago

Thanks first, and sorry for the late reply. Is it possiable to keep the original RGB values event alpha is zero in the images processed by pngquant?

kornelski commented 4 years ago

I've intentionally made it completely impossible. Indexed 8 bit color can't afford it, so RGB of transparent colors is the first thing pngquant completely clears.