Mobile app version of vmapp.org
Login or Join
Shelley591

: 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

@Shelley591

Posted in: #Gimp

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.

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Shelley591

2 Comments

Sorted by latest first Latest Oldest Best

 

@Barnes313

In short:

I'd decompose the image two times, once into RGBA and once into HSV or HSL, with the Decompose filter: 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: docs.gimp.org/en/plug-in-compose.html

10% popularity Vote Up Vote Down


 

@BetL875

An easy way to add transparency in Gimp is to convert a color to alpha by choosing Layer > Transparency > Color to Alpha.

In your example choosing white as the color to convert to alpha (i.e. is fully transparent) will lead to the desired result making black 100% opaque, white 0 % opaque (i.e. transparent), and giving all shades of grey a corresponding semi-transparency:

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme