I have a GIF that I'm making in GIMP with some whites in the image. The color code before I turn the layers into a GIF is #ffffff. But when I open the image, the whites have been changed to #fdfffc. Is there some color profile setting I need to tweak to prevent this?

  • I don't know a setting to make sure the colours are assigned how you want them to be, but as you may already be aware, GIF files are limited to 256 colours per frame. So it might have run out of colours trying to choose colours that represent the colours in the image as well as possible. Maybe you could reduce the number of colours in the image or something?
    – Ryan1729
    May 29 '19 at 2:12

If you do the indexing explicitly (Image>Mode>Indexed...) instead of letting Gimp do it automatically then you have more options, and one of the options is to provide a palette. The problem is now to come up with an adequate palette, but you can get Gimp's help:

  1. Open the RGB-mode image
  2. Image>Mode>Indexed..... Tick "generate optimum palette" and set the maximum number of colors to 255.
  3. Open the Palettes dialog (Windows>Dockable dialogs>Palettes)
  4. In Gimp 2.10, you will find at the top of list a palette called "Color map of image #1" (or #2, #3...).
  5. Right click it and duplicate it
  6. Double-click the copy to edit it, use the palette editor to add a 256th entry, and set it to white
  7. Back to the image, and Ctrl-Z to de-index it
  8. Image>Mode>Indexed, Use custom palette and select the palette you created above.
  • Thanks a bunch for the thorough answer. This doesn't seem to be fixing it though. It still exports to the barely off-white color.
    – snapcrack
    May 30 '19 at 3:50
  • Can you add a sample image (small crop that exhibits the problem)?
    – xenoid
    May 30 '19 at 8:07
  • Could be a bug. The method works if instead of adding a white color in the map, you edit the off-white entry in the palette to make it plain white. But of course some of your off-white pixels will become plain white.
    – xenoid
    May 30 '19 at 9:13
  • I think it must be a bug of some kind. Tried manually editing the off-white entry too. It just turns it into the off-white after I export to gif.
    – snapcrack
    May 31 '19 at 6:05
  • @snapcrack That last one definitely works for me. If you specify a palette, Gimp can't/won't create colors. Did you really specify the new palette when converting to RGB the second time?
    – xenoid
    May 31 '19 at 6:59

Another simple method:

  • Add a layer, fill with white (or whatever color should be in the map)
  • Image>Mode>Indexed (you can use defaults). Since Gimp creates a colormap for the whole image it will keep the white for the all-white layer.
  • Delete the white layer

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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