Take the 2-minute tour ×
Graphic Design Stack Exchange is a question and answer site for professional graphic designers and non-designers trying to do their own graphic design. It's 100% free, no registration required.

I would like to know how can I change color of RGBA image when alpha channel will be unchanged for each pixel. If I use Paint Box Tool it will set alpha channel for all pixels to constant value.

Look at picture: changing color of RGBA image in Photoshop

share|improve this question
add comment

migrated from stackoverflow.com Dec 15 '11 at 18:56

This question came from our site for professional and enthusiast programmers.

4 Answers

up vote 2 down vote accepted

There's an option somewhere on the tools pallet called 'preserve transparency' that should do exactly what you are looking for.

share|improve this answer
    
Thank you for your answer - it is exactly what I need. –  Boris Šuška Dec 15 '11 at 20:37
add comment

The fast way to accomplish this, rather than using the Paint Bucket, is to use the keyboard shortcuts.

To fill with color while preserving transparency hold down Shift while you fill using:

  • Ctrl-Backspace/-Delete or
  • Alt-Backspace/Option-Delete

I don't remember when I last used the Paint Bucket. It's been so long I'd forgotten it was there...

share|improve this answer
    
I don't think I've used that modifier before. Good tip. –  Mr.Wizard Dec 16 '11 at 19:33
add comment

Although not as slick as Alan's method, which I will be using after this, a general method is to lock layer transparency before fill, painting, filters, etc.

share|improve this answer
add comment

All the current answers are probably better solutions in most cases, but in some cases you can also:

  • Just apply a layer style to the color/gradient/pattern you want. Which I find slightly easier to make adjustments to—since you can adjust the color using the color picker dialog with a live preview, and layer styles also have other advantages (being saveable, easily transferred/copied, gradients hold up better when converting color profiles)
  • Using a clipping/layer mask—this can be done in a few ways:

    1. Load the selection from the existing layer; then create a new fill layer (either a solid color, gradient or pattern).
    2. Or select the existing layer and hit Ctrl+Shift+N to create a new layer, checking the Use Previous Layer to Create Clipping Mask option.
    3. Or just select the existing layer; hit Ctrl+Alt+Shift+N, and then hit Alt+Ctrl+G
    4. Or you can create a layer mask by loading selection from the existing layer and then going to Layer > Layer Mask > Reveal Selection.

    It's a slightly more roundabout way to achieve the same general thing, but clipping/layer masks let you do some cool things sometimes, like just painting or pasting images into the layer and still preserve the alpha channel.

share|improve this answer
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.