Closed hoontee closed 11 months ago
Unfortunately this is not possible. pngquant internally operates in premultiplied alpha color space, so it's incapable of preserving color of fully-transparent pixels (it's a division by zero).
Additionally, even if the code was changed to operate on uncorrelated RGBA, this would severely degrade color quality of visible pixels. This is because the PNG8 mode doesn't have a separate alpha channel, so it would use palette entries for each RGBA combination.
In addition to fixing #402 for the purposes of my project, it's necessary to preserve the color for fully transparent pixels. Currently pngquant ignores this data and replaces it with black:
Source pngquant output
Hopefully a new CLI argument can be added for this.