How can I make the alpha in a layer proportional to the darkness?

I have a layer that I want to merge and I want the dark colors in the layer to have more weight. How can I make it so that black pixels are 100% opacity, white pixels are 0%, and #7F7F7F pixels are 50%? I tried adjusting color curves, but that doesn’t seem to be what I want.

Answer

In short:

I’d decompose the image two times, once into RGBA and once into HSV or HSL, with the Decompose filter: http://docs.gimp.org/en/plug-in-decompose-registered.html

Then, I’d do a RGBA compose with the RGB components taken from the first, and the V or L component (inverted prior to the compose, probably) of the second decompose for the A component: http://docs.gimp.org/en/plug-in-compose.html

Attribution
Source : Link , Question Author : aebabis , Answer Author : Michael Schumacher

Leave a Comment