Post Reply 

A specific color to transparent

Dec 26, 2011, 06:10
Post: #1
A specific color to transparent
I have a jpeg image of a motorcycle on a pure yellow background. I want to make the yellow transparent. Naturally there are a lot of spaces within the motorcycle image that contain yellow.

I followed instructions I found...

Removing the background of an image
1) add an alpha channel to your layer
2) use colors/color to alpha and use the background color


This results in the checkerboard being applied to the motorcycle, not the yellow background. I assume that's okay.

This makes all the pixels with the background color transparent, and those with a close color partially transparent.

Then:
- select the background with the magic wand,
- grow the selection by a couple of pixels to ensure that the border of the sprite is in the selection (the most important work of color-to-alpha is on the border pixels, so they shouldn't be protected)


This selects only the area outside the bicycle, but I don't mind reselecting smaller areas, if I can.

- grow the selection by a couple of pixels to ensure that the border is in the selection (the most important work of color-to-alpha is on the border pixels, so they shouldn't be protected)

Then what?
Find all posts by this user
Quote this message in a reply
Jan 1, 2012, 04:33
Post: #2
RE: A specific color to transparent
Sorry to be so late getting back on this, but I was a combatant in the Computer Wars, with a wireless router skirmish thrown in. Missing an arm and a leg now, but otherwise okay.

When I followed the above instructions, I got as far as Colors/color to alpha, only to find that color to alpha was grayed out, leaving me with nowhere to go.
Find all posts by this user
Quote this message in a reply
Jan 1, 2012, 18:38
Post: #3
RE: A specific color to transparent
No, it was a jpg image, then converted to XCF as you instructed. If I open the jpg image, then color to alpha isn't grayed out.
Find all posts by this user
Quote this message in a reply
Jan 1, 2012, 20:53
Post: #4
RE: A specific color to transparent
And "Indexed" isn't selected on the XCF file. RGB is.
Find all posts by this user
Quote this message in a reply
Jan 2, 2012, 00:36 (This post was last modified: Jan 2, 2012 01:14 by quailrancher.)
Post: #5
RE: A specific color to transparent
There was a selection mask showing in the channels dialogue. I deleted that and the color to alpha returned. I clicked on that, the proper color was selected, and the bar moved across the screen. The image was unchanged, so apparently there was something I didn't do.
Find all posts by this user
Quote this message in a reply
Jan 2, 2012, 01:53
Post: #6
RE: A specific color to transparent
I see my image, labeled "background" under layers. Only one. " Add alpha channel" is grayed out.
Find all posts by this user
Quote this message in a reply
Jan 2, 2012, 02:55
Post: #7
RE: A specific color to transparent
Alas, Photobucket won't pick up the Gimp image. Maybe I'll go back to my old version of Photoshop and see what I can stumble across. Many thanks for the effort.
Find all posts by this user
Quote this message in a reply
Jan 2, 2012, 17:15
Post: #8
RE: A specific color to transparent
Serves me right for using the quick reply.


Attached File(s)
.xcf  Copy of Copy of Harley Blackline transparent.xcf (Size: 3.01 MB / Downloads: 58)
Find all posts by this user
Quote this message in a reply
Jan 4, 2012, 03:58
Post: #9
RE: A specific color to transparent
(Jan 2, 2012 18:09)ofnuts Wrote:  
(Jan 2, 2012 17:15)quailrancher Wrote:  Serves me right for using the quick reply.
Worked for me... make sure that the background color is properly selected (red ellipse), and if not, use the color picker on the background:



Otherwise I didn't see anything weird in your file. This is one case where the Color select tool (Bycolorselect) is better than the wand (Fuzzyselect), even if this picture has a few left-overs from a previous life (it likely had a shadow(*)).

Final file in attachment, took all of 20 seconds:

- Color select
- click background
- Select/Grow
- Color to alpha
- Click color tab
- Click color picker
- Click background
- OK, OK
- done.

So despite the attached file I'd recommend that you try yourself just to get convinced I have no magical powers or a special version of Gimp.

(*) The Honda guys(**) love to think that all HD owners have a Shadow... Smile
(**) Not me, I have three tuning forks tattooed on my brain.

Thanks. It looks great, and the step by step means even I can do it, maybe.. Now I have to study so I can use layers effectively.
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  How to color bended text? Msa0503 1 47 Yesterday 08:23
Last Post: ythgilb
Question Saving to a gif format and choosing the color palette SpongeBob 0 75 Dec 13, 2017 19:13
Last Post: SpongeBob
  Color filled letters Dan M 1 74 Dec 13, 2017 17:12
Last Post: paynekj
  not able to draw different color rectangles manish 1 94 Nov 3, 2017 04:01
Last Post: ythgilb
  Desaturate to color KWiK 2 189 Oct 9, 2017 22:14
Last Post: KWiK

Forum Jump:


GIMP ForumPortalArchiveContactTermsRSS