Import damages colormap numbering
Submitted by TKZV
Link to original bug (#791531)
Description
Created attachment 365449 A file that will be damaged by GIMP import-export.
When I import indexed 8-bit PNGs, one of colormap entries is deleted and the rest are shifted. This is very problematic for people working with large libraries of images with identical colourmaps, when everybody assumes that index unambiguously defines a colour.
To reproduce:
-
Open the attached "TECHNOMAD-original.png" in a program that can display the "palette" of indexed colours (I used IrfanView 3.98). — There are 256 colours. The first are: 0: #000000 (actually, it's transparent) 1: #FCFCFC 2: #E8E8E8 3: #D8D8D8 ... 16: #FCD000 ...
-
Open the same file in GIMP. When prompted to convert to RGB working space, select "keep". Open "Colormap" window. — There are only 255 colours. The first are: 0: #FCFCFC 1: #E8E8E8 2: #D8D8D8 3: #C4C4C4 ... 15: #FCD000 ...
-
Export the file to 8-bit PNG under another name. Check its palette. (See also the attached "TECHNOMAD-exported.png".) — The 1st colour is black again, #FCFCFC disappeared, and the rest are shifted by 1 from their original positions.
-
Import the exported file to GIMP again; when prompted to convert, press "keep", check the colormap. — There are only 254 colours, they are shifted by 2: 0: #E8E8E8 1: #D8D8D8 2: #C4C4C4 ... 14: #FCD000 ...
Attachment 365449, "A file that will be damaged by GIMP import-export.":
Version: 2.9.6