Post Reply 

Why is GIMP changing colors when exporting to GIF?

May 7, 2014, 15:01
Post: #1
Why is GIMP changing colors when exporting to GIF?
Hello,

I have a simple, small image (300x100), pure white background and one text layer.

When I export to GIF with all the text one color, it seems to export just fine. But if I add some of text in a different color and export, the pure white background (r255 g255 b255) in the GIF inexplicably changes to not-quite pure white (r254 g255 b252).

I also tried creating two separate text fields instead of one (one for each text color) - same problem. I tried using different fonts - same problem. I tried switching from 2.8.0 on Windows 7 to 2.8.10 on Mac OS X - same problem. I even tried indexing the image before export; oddly, that rendered the image very blocky and completely unaliased no matter what settings I chose (GIMP does a much better job indexing during export anyway).

I noticed that if I only have a "little bit" of the blue text and a "little bit" of the grey text, it works...but adding different amounts of blue text will cause the issue, and the amount isn't consistent, depending on what letter I use.

In my frustration, I tried a competing program and it exhibited no such issue. But I'd rather use GIMP.

Is it unreasonable to expect GIMP to at least include in the output GIF color map the only 3 colors I'm explicitly using? I would think since there are so few colors, those would get special priority...

Any ideas? Thanks!


.xcf  problem.xcf (Size: 11.03 KB / Downloads: 50)

Note background is pure white.
   

Note background is not pure white; only change was text in a different color.
   
Find all posts by this user
Quote this message in a reply
May 7, 2014, 15:43
Post: #2
RE: Why is GIMP changing colors when exporting to GIF?
The above is the problem. If you look at the colormap lots of off-white.

Before you export to a gif file go into image -> mode and convert to an optimised palette, then export to gif.

[Image: iK5pkRM.jpg]

** https://www.gimp-forum.net/ now answering questions**
Find all posts by this user
Quote this message in a reply
May 7, 2014, 16:38 (This post was last modified: May 7, 2014 17:05 by nabziF.)
Post: #3
RE: Why is GIMP changing colors when exporting to GIF?
First, thanks for the feedback!

(May 7, 2014 15:21)paynekj Wrote:  When I then flatten the image, still in RGB mode, there are 236 unique colours, so adding extra colours will certainly take you over the 256 unique colours available in GIF images.

Ok, but shouldn't my 3 explicitly used colors (especially the background at least!) take precedence over any colors generated through anti-aliasing, when the GIF color map is generated? I can't imagine anyone would think adding one more barely-used anti-aliasing shade at the expense of the entire background field color is acceptable, so I think I'm doing something wrong, missing some vital step. And if there really are as many unique colors as you saw, why is the output GIF only 128? If only 128 are needed to make it look great, why can't color 129 be the original color that comprises 80+% of the image?
(Incidentally...how did you determine the number of unique colors present in the non-indexed image? The color map just shows blank unless I index it..)

(May 7, 2014 15:43)rich2005 Wrote:  Before you export to a gif file go into image -> mode and convert to an optimised palette, then export to gif.

Yeah I tried that; I was doing it wrong earlier (hadn't flattened first), but even when I flatten then index to optimised 255 color palette, pure white is still sacrificed for the sake of an in-between aliasing shade, and the color map only shows a bit over half of 256 shades actually present.
Find all posts by this user
Quote this message in a reply
May 7, 2014, 18:43 (This post was last modified: May 7, 2014 18:44 by rich2005.)
Post: #4
RE: Why is GIMP changing colors when exporting to GIF?
OK, one way that preserves the antialising

Do all your editing and as Kevins post you will have too many colours if you go straight to gif.

Gimp is not so good at reducing colours, so you are stuck with the posterize filter.

Merge the layers first.

screenshots: http://i.imgur.com/E7n6NQU.jpg

Now when you change the mode to indexed you have a sensible colormap with a ffffff white.

** https://www.gimp-forum.net/ now answering questions**
Find all posts by this user
Quote this message in a reply
May 7, 2014, 19:47 (This post was last modified: May 7, 2014 19:50 by nabziF.)
Post: #5
RE: Why is GIMP changing colors when exporting to GIF?
(May 7, 2014 18:43)rich2005 Wrote:  Gimp is not so good at reducing colours, so you are stuck with the posterize filter.

Merge the layers first.

screenshots: http://i.imgur.com/E7n6NQU.jpg

Now when you change the mode to indexed you have a sensible colormap with a ffffff white.

Posterizing does indeed appear to preserve the white background once the image is then color indexed (if the posterize level setting is kept low enough)...but then the primary text colors change upon indexing (and I'm eyedropping in the middle of a character zoomed way in, well away from the anti-aliased edges, which of course will vary in shades). I suppose the text changing slightly isn't as noticable as the field itself changing, but this seems to be a bit of a game and trickier than I thought it would be. Confused

Thanks for your suggestions though!
Find all posts by this user
Quote this message in a reply
May 9, 2014, 07:10
Post: #6
RE: Why is GIMP changing colors when exporting to GIF?
(May 7, 2014 19:47)nabziF Wrote:  ...but then the primary text colors change upon indexing (and I'm eyedropping in the middle of a character zoomed way in,...

But does it look ok if your zoomed 100 % ?

"In order to succeed, your desire for success should be greater than fear of failure." BC
[Image: 29uocaf.png]
iFS007 tut vids on YT ~ auto color B&W landscape tut
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  GIMP on older pc elyman 1 31 Dec 10, 2018 17:17
Last Post: paynekj
  Changing A Color Ricebug 1 672 Oct 10, 2018 16:50
Last Post: paynekj
  exporting png to PDF problem switched 1 269 Sep 20, 2018 09:31
Last Post: switched
  Blurry GIMP interface on macOS High Sierra 10.13.6 vagkavo 1 233 Aug 26, 2018 07:52
Last Post: paynekj
  Gimp wont keep merging when exporting Ergu 1 268 Aug 8, 2018 21:22
Last Post: paynekj

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS