Graphic Design Stack Exchange is a question and answer site for Graphic Design professionals, students, and enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there an utility for converting all black-white and grayscale images from certain folder to the same images with adjusted alpha channel?

For example, for pixel (r:50, g:50, b:50, a:0) I would like to get (r:50, g:50, b:50, a:50) and (r:50, g:50, b:50, a:205) (inverse). Of course, this conversion is suitable only for image formats with alpha channel support (not JPG).

Or how can I do it with photoshop?

Background: I am a programmer and I am finding a way to do it without coding if it's possible.

share|improve this question
up vote 1 down vote accepted

You cannot with Photoshop. It's a very specialized operation you're seeking and will need to be done programmatic.

I'm not sure what the purpose is of moving the luminance as alpha, but be aware that RGB=50,50,50 will not produce the same result as with RGBA=50,50,50,50. The correct, visually, value would be RGBA=255,255,255,50 as alpha channel value of 50 will produce (A*R/255 or A*G/255 etc) 50*50/255 (=10) in your example, versus 50*255/255 (=50 same as the value without alpha channel).

share|improve this answer
I believe RGB 50,50,50, woud be (approximately) 20% black. So the RGBA equivalent using fully alpha would be RGBA(255,255,255,.2) right? (I may be wrong) – DA01 Oct 29 '12 at 0:18
That should be correct (255 x .2). – K3N Oct 29 '12 at 0:34

Your Answer


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.