Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Couldn't export grayscale transparent image to GIF
#1
I've been working with a similar type of grayscale transparent images and they exported fine in PNG & GIF. As mentioned, with something similar, it exported fine in PNG but was added a black background (to where the transparency should have been). I thought perhaps it was my usage of GIMP so I found an online tool, uploaded the PNG (recently exported) then saved it into GIF through them and the transparency was as it should.

I opened the image expecting it to have been converted into RGB but it was indexed. So I went back to my GIMP image, changed the mode to indexed and was surprised all 256 colors were taken; I thought it would have been 100 or less.

Was I on the right path, that there was too many colors for a GIF? Is there something I could do so this situation doesn't reoccur? Otherwise, it wouldn't be a big hassle and when that happen I'll convert it to indexed.

Oh and the mode that there shoudln't be duplicate indexed colors was on when I converted (and all 256 colors were taken).

Update 1: The exact mode name, along with the rest of the conversion options:
   
Reply
#2
The color map in a GIF is 256 colors. What do you mean by "to many colors". In a grayscale image, you can have 256 levels in 8-bit mode, so you need the whole colormap.
Reply
#3
There was an error message but it was showed about just a second. I managed to get its content through menu > Windows > Dockable Dialogs > Error Console; it is:

Quote:  GIF image Warning
Couldn't simply reduce colors further. Exporting as opaque.

I didn't want to attach the whole things as it's copyrighted so I wanted to only show a quarter, I tried all 4 corners and the middle but a quarter won't create the error (so I'm attaching the whole thing).
   

The issue happen both from the original file (XCF) and what I just attached. To make sure the error is duplicable, I opened what I just attached and right away exported it into a GIF with the settings
   
and the transparency was removed along with showing the same error message.

Hopefully this is clearer than the OP.
Reply
#4
OK, got it. It seems your grayscale picture contains 256 colors (Colors>Info>Colorcube analysis). In the GIF format, you can have 256 colors, but... the "transparency" of pixels is indicated by painting pixels in some predefined color and indicating that this color should be made transparent. So if you have a transparent image you only have 255 real colors to work with for the opaque parts.

So, what that cryptic message is telling you is that Gimp cannot find a a free color slot to create that transparent color. The solution is to sllghtly the number of color in the image to make room for the transparent color Colors>Posterize and posterize to 255 colors. Then there is one unused slot in the color map and you can save as a transpatent GIF.
Reply


Forum Jump: