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.


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).

  • 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). – user7179 Oct 29 '12 at 0:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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