0

I exported a bunch of png files from R. The pictures are of a dataset that is 'spinning' against a white background. I then use GIMP to stitch them together and export an animated gif. Unfortunately, the gif has a yellowish color instead of a white background like the original files. This yellowish color was not there when I used to do this in imageMagick and isn't even there when I preview the files in GIMP. It only appears after I do the export as a gif. Does anybody know what is going on and how I can correct this?

user3390169
  • 1,015
  • 1
  • 11
  • 34

2 Answers2

2

GIF files are limited to 255 colors. If you don't downsacle colros prior to exporting them, GIMP will do that automatically at the export step itself. It is at this point that your yellowish background is being created.

The workaround is quite simple: convert your image to the indexed color model before exporting the GIF file (image->mode->indexed) ( perceive you could even force a custom crafted palette at this step). If after this conversion the backgroound is already yellowish, you can manually redefine it on the Color Map dialog (search for it on the Windows->Dockable menu) - pick the background color, and change it for white.

When exporting the Indexed image to an animated GIF there is no color conversion step, and the colors of the GIF are saved as they are seen on the screen

jsbueno
  • 99,910
  • 10
  • 151
  • 209
0

The issue here is GIMP is trying to do its best to convert your image down to 255 colors, and that is where it is failing. What I recommend for people on OSX is to get this program called ImageAlpha (it is free) https://pngmini.com/. It does a very good job and compressing png images without much loss. If anybody has a recommendation for a Windows app that would do this, please post it here for reference.

Knight0fDragon
  • 16,609
  • 2
  • 23
  • 44
  • ImageMagick worked great but my company is cracking down on unsupported software. We have GIMP so that is what I am using:( Is there a way to take the snapshot in R so that GIMP can better handle it? – user3390169 Dec 18 '15 at 23:49
  • if you have to use gimp, then play with the palette options. Dunno what you mean by snapshot in R – Knight0fDragon Dec 19 '15 at 06:32