RSS/Atom feed Twitter
Site is read-only, email is disabled

alpha channel computation

This discussion is connected to the gimp-user-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

2 of 2 messages available
Toggle history

Please log in to manage your subscriptions.

alpha channel computation Nerius Landys 24 Jul 20:49
  alpha channel computation Sven Neumann 24 Jul 21:33
Nerius Landys
2008-07-24 20:49:27 UTC (over 16 years ago)

alpha channel computation

Hello. I have a TGA image that is fully opaque. I want to introduce translucency to the image, making each pixel translucent according to how far away from black it is. If a pixel is originally black, it becomes fully opaque. If a pixel is originally white, it becomes fully transparent. If a pixel is 0x7f7f7f (gray) or 0xff007f (approximately halfway in brighness between dark and light), it becomes somewhere around half transparent (computed using diagonal of color cube).

Is there an easy way to do this in GIMP? i can imagine writing a quickie computer program to do this for me, but I'm sure the easier way would be to convince GIMP to do this for me.

Thanks.

Sven Neumann
2008-07-24 21:33:15 UTC (over 16 years ago)

alpha channel computation

Hi,

On Thu, 2008-07-24 at 11:49 -0700, Nerius Landys wrote:

Hello. I have a TGA image that is fully opaque. I want to introduce translucency to the image, making each pixel translucent according to how far away from black it is. If a pixel is originally black, it becomes fully opaque. If a pixel is originally white, it becomes fully transparent. If a pixel is 0x7f7f7f (gray) or 0xff007f (approximately halfway in brighness between dark and light), it becomes somewhere around half transparent (computed using diagonal of color cube).

Is there an easy way to do this in GIMP?

Easy. Just add a layer mask. In the dialog for creating the mask, choose to initialize the mask with "Grayscale copy of layer". Now you already got almost what you want. You just need to invert the mask as you want white to be transparent and black to be opaque. Colors->Invert will do this. Now all you need to do is to apply the layer mask.

Sven