PNG with indexed palette and semitransparent colors loses colors on saving
GIMP version: 2.10.8 libPNG version: 1.2.59 GEGL version: 0.3.26
Operating System: Linux
Package: Gentoo package fom the portage tree
Description of the bug
Given is a PNG image with a 4 bit color palette and 5 colors, where 4 of these colors are transparent.
When you open and save that image, the alpha value of the semitransparent pixels disappears.
Is the bug reproducible? Always
- Open the provided image with GIMP. It is imported as indexed color 8-bit gamma integer, GIMP built-in sRGB.
- Pick File -> Overwrite <filename.png>
- The file is still saved with a 4 bit color palette, but the semi-transparency on the black, gray, white pixels disappeared. Only the full-transparent background is kept.
The only solution is to save the image in RGB mode and convert it back to 4 bit with optipng later.
Expected result: The image should be saved as it was before.
Actual result: Alpha value is not correctly treated.