Page 1 of 1

How do you create a multi transparent PNG

Posted: 2012-09-24T11:22:32-07:00
by clownpleco
I have 2 pngs. The first is a gray shade infrared satellite image. The second is a gray shade image representing the transparency of each individual pixel. Basically I want to make the colder clouds less transparent than the warmer clouds.

1) What should the gray shade values be set to in the transparency image.
2) Is there a convert and or compose command to get the desired results.

Thanks

Rick

Re: How do you create a multi transparent PNG

Posted: 2012-09-24T13:07:19-07:00
by fmw42
Grayscale values typically are 0 to 255 if 8-bit image and 0 to 65535 for 16-bit image. But if you want more or less effect you can use -level or +level to adjust the grayscale values

To put the grayscale image as a transparency layer use:

convert baseimage transparencyimage -alpha off -compose copy_opacity -composite result.png

If the result is showing the opposite of what you want transparent, then use -negate on the transparency image to reverse the polarity.

see
http://www.imagemagick.org/Usage/color_mods/#levels
http://www.imagemagick.org/Usage/compose/#compose
http://www.imagemagick.org/Usage/compose/#copyopacity