Take the 2-minute tour ×
Graphic Design Stack Exchange is a question and answer site for Graphic Design professionals, students, and enthusiasts. It's 100% free, no registration required.

I have an .xcf image and I like to change the color of some objects within it. The objects are mostly one solid color with the edges feathered into transparency. I.e. all pixels in the object are white with most pixels fully opaque and some with transparency.

I've tried to change the objects' color using the color select tool + bucket fill but this destroys the feathering. Is there a way to get the gimp to change just the color but preserve the transparency?

The actual objects that I have are multiple bits of text all at different sizes and rotations that I have merged into one layer. So it is no use re-adding the feathering as this messes up the text quite noticeably.

Thanks

share|improve this question
    
I think, from a technical standpoint, "feathered into white, simulating a transparency" would be the proper description of what you have. In CG, "transparency" is an attribute of an image or layer within an image that is represented by (for instance) a grayscale mask, and can be adjusted without altering the actual image data. –  horatio Jun 14 '11 at 19:28
    
@horatio Thanks, but I'm confused. Are you saying there is a way to do this? I dont think you are correct when you say it is "feathered into white, simulating a transparency". The solid pixels are coloured white and at the edge, the feathered ones are white semi-transparent. Ie you can add a background layer, and no matter what background colour you choose the text will feather correctly. –  spiderplant0 Jun 14 '11 at 20:13
    
I misunderstood what you wrote then. –  horatio Jun 14 '11 at 20:18
add comment

7 Answers 7

up vote 6 down vote accepted

Try checking the "Lock" option for the layer (which prevents transparent pixels from being filled), then use the Fill Bucket. If that doesn't work, you may have to take a slightly roundabout approach. From what I can tell (I'm taking this from the documentation as I don't have Gimp installed) this will work:

Add a black layer below your feathered white layer, so that what you see is your white feathered object against a black background.

Right-click one of the RGB channels (they should all be the same) and choose "Duplicate Channel" to make an alpha channel that looks like your regular composite view.

Delete or hide the black layer.

Create a fresh blank layer, then turn your saved channel into a selection by right-clicking and choosing "Channel to Selection".

Fill the selection with your new color, and hide the white layer.

(Note: In Photoshop, you add Shift to the keyboard shortcut for Fill -- the Backspace/Delete key plus Ctl/Cmd for background color or Alt/Option for foreground -- as the quick way to fill while preserving transparency. The Gimp UI does things a differently, but I would expect there is a similar keyboard shortcut somewhere, if you poke around in the documentation.)

share|improve this answer
    
Thanks @AlanGilbertson the 'lock' option was just what I was looking for. –  spiderplant0 Jun 15 '11 at 13:15
    
Glad to help. I don't use Gimp, so I was extrapolating from the way things work in Photoshop. The Gimp docs aren't entirely clear. –  Alan Gilbertson Jun 15 '11 at 18:38
add comment

Personally my favorite approach is Color->Hue, Saturation... and use sliders.

share|improve this answer
add comment

You could also convert the transparency into a layer mask using Layer → Mask → Add Layer Mask... and selecting the "Transfer layer's alpha channel" option.

This will let you edit the color and transparency components of the layer independently. In particular, to recolor an object, you can just select a region around it and fill it with a solid color.

share|improve this answer
    
I was working with a png and didn't have the original xcf available. This method did exactly what I needed. –  jacobwalker0814 Nov 29 '13 at 20:38
add comment

I just figured this out too. I'm designing my logo and have a transparent background so I can apply the logo anywhere.

If your background is already transparent, then lock it and you can use the Bucket Fill tool. Retains the feathering and you can use any ol' color you like!

share|improve this answer
    
This looks like it should be a comment on Alan's solution, not a new answer. –  e100 Nov 27 '12 at 18:45
add comment

your background is already transparent, then lock it and you can use the Bucket Fill tool. Retains the feathering and you can use any ol' color you like!

share|improve this answer
add comment

I think I found the easiest way to do this (at least for me), running GIMP 2.8.3.

  • Open the image to change.
  • Select the pen.
  • In the upper right, select the tab that's 3 layers: RGB.
  • In the cell regarding alpha, click it so it's no longer selected.

Now, when you draw, the colours can change, but the alpha won't.

  • Draw the desired colour over the existing pixels. Make sure to get the whole image.

Voila! It's in another colour, but the alpha stays the same.

share|improve this answer
add comment

If you have an option to merge a layer by "darkening only," you might eliminate the white halo effect you are seeing, but I doubt it will be perfect.

share|improve this answer
    
What white halo effect? –  spiderplant0 Jun 14 '11 at 20:16
    
I misunderstood the problem. I actually thought you were trying to bucket fill the background –  horatio Jun 14 '11 at 20:19
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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