GIMP: Colors change when I open a gif as layers rather than as an image

2

I've got a 3-color gif image (#FFFFFF, #3B5AA3, #BE0027).

When I open it as an independent image in GIMP, it renders fine.

But when I open it as layers for another image (or copy the layer from opening it as an image) the colors change (to #EFC52E, #EE6D2A, #EE862B).

What's going on? How can I fix this?

rampion

Posted 2011-07-08T18:10:53.147

Reputation: 3 130

Answers

1

The issue is probably caused by the fact that GIF uses indices into a 256 array of colours to specify the colour at each pixel. It's highly unlikely that any two GIF images will share the same colour palette.

So when you open image A it uses it's palette where pixel 1,1 points at index 23 which is blue (for example). Now when you open image B index 23 will use this colour rather than the colour out of its palette (which is red - for example). So image B will look wrong.

If you convert all the images to PNG or some other true colour format you won't get this issue. You can then combine the images and then save back out to GIF if required.

ChrisF

Posted 2011-07-08T18:10:53.147

Reputation: 39 650