Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.