Post Reply 

changing white in foreground to a color

Mar 13, 2012, 04:05 (This post was last modified: Mar 13, 2012 04:12 by hyrulian.)
Post: #1
changing white in foreground to a color
Hi all,

I am a total gimp newbie here. I can crop images, resize, and do a few other things but that is about the extent of my skills.

I am currently attempting to theme some images in an Android ROM but I'm not able to change the colors the way I want. Essentially I have a bunch of images with transparent backgrounds and white in the foreground. I simply want to swap out the white for another color (red, green, blue, whatever).

I have attached a sample image that I am working on. How on earth do I change the white to red (FF0000) for example? I tried using the Bycolorselect select by color tool and clicking in the white area. Then I changed the foreground color to FF0000 and tried to paint into it. It doesn't seem to do anything but paint more white?

I even tried googling this a bit and looking in this forum but the options that people were talking about were completely disabled for my image. For example, I went to Colors > Map and found that both Color Exchange and Rotate Colors are disabled. Why?

I'm sure this is really simple but I just need to figure out how to do it. I know I have some fundamental lack of understanding about how all of this stuff works but I just don't know what it is. If anyone can shed some light on how to accomplish this I would appreciate it. Thanks!


P.S. I have roughly 200 images that I need to perform this action on (and I may even do this with multiple colors -- create a blue set, a red set, etc.) so if there is some way to automate this process I would love to know. I'm a software developer and run Linux so I typically just write bash scripts for tedious tasks such as these. I know there is script-fu in gimp but I'm not familiar with it. Can I just call gimp within a bash loop and pass it some option to do this color change and save the new image for me?


Attached File(s) Image(s)
   
Find all posts by this user
Quote this message in a reply
Mar 13, 2012, 04:23 (This post was last modified: Mar 13, 2012 04:24 by hyrulian.)
Post: #2
RE: changing white in foreground to a color
Ok just an update...I figured out why I couldn't use those options. The image mode was set to indexed instead of RGB. So I guess that first I need to change it. Once that is done, I can't just select white because there are some very bright shades of grey in some of the images as well. I would like to also convert those colors. When I tried Colors > Map > Color Exchange it almost worked, but those few grey pixels are unchanged.

I have no clue how to use this rotate colors option. I would like to tell it to convert everything in the range of pure white-grey to a new color. Is that possible?
Find all posts by this user
Quote this message in a reply
Mar 13, 2012, 05:33
Post: #3
RE: changing white in foreground to a color
Hi and welcome to the forum Smile

Have a look here for answer, changing a color in gimp. "Lock alpha channel" checkbox in the layers dialog.

GIMP user forum here at GIMP Forums. A friendly place to learn GIMP!
Everyone's welcome, feel free to join the community.
Visit this user's website Find all posts by this user
Quote this message in a reply
Mar 13, 2012, 07:40
Post: #4
RE: changing white in foreground to a color
(Mar 13, 2012 04:23)hyrulian Wrote:  Ok just an update...I figured out why I couldn't use those options. The image mode was set to indexed instead of RGB. So I guess that first I need to change it. Once that is done, I can't just select white because there are some very bright shades of grey in some of the images as well. I would like to also convert those colors. When I tried Colors > Map > Color Exchange it almost worked, but those few grey pixels are unchanged.

I have no clue how to use this rotate colors option. I would like to tell it to convert everything in the range of pure white-grey to a new color. Is that possible?
For bakchground information read this: http://gimpforums.com/thread-proper-subj...d-painting

If you are using indexed images than may be you only have to change the RGB values in the color table. This can be done in Gimp (Windows/Dockable dialogs/Color map), but if you have many images to process have a look at ImageMagick (http://www.imagemagick.org) which is command line mode image "transformer", and can very likely be used for this (they have a very helpful support forum on their site). ImageMagick is OSS software and available in the repositories of all major distros.

Now answering your questions on
https://Gimp-Forum.net
Visit this user's website Find all posts by this user
Quote this message in a reply
Mar 13, 2012, 20:32
Post: #5
RE: changing white in foreground to a color
Thank you both for your excellent replies!
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Is the "Change Foreground Colour" window dockable ? Ceriano 2 88 Oct 14, 2017 17:22
Last Post: Ceriano
  Desaturate to color KWiK 2 108 Oct 9, 2017 22:14
Last Post: KWiK
  Removing color from multiple images Aquilo 6 2,919 Sep 28, 2017 12:56
Last Post: angel0sdh
  turning the back ground white error718 0 87 Sep 22, 2017 19:43
Last Post: error718
  best tutorial for changing someone's head to another body JaDan 19 9,106 Jul 20, 2017 05:07
Last Post: ythgilb

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS