Page 1 of 1

Make Pixel Transparent Based on Level

Posted: 2018-01-17T23:07:44-07:00
by justin9999
Is there a way to make a pixel transparent based on its brightness level?

I would like to be able to make all pixels transparent that are in the bottom 50% of the brightness range. Let's call this image A, and say it is derived from a photo that is overexposed.

I would like to be able to make all pixels transparent that are in the top 50% of the brightness range. Let's call this image B, and say it is derived from a photo that is underexposed.

I would like to see what happens when I blend images A and B together. I hope to make an HDR image.

Re: Make Pixel Transparent Based on Level

Posted: 2018-01-18T04:13:21-07:00
by snibgo
What version of IM on what platform? I'll assume v6 on Windows CMD.
justin9999 wrote:I would like to be able to make all pixels transparent that are in the bottom 50% of the brightness range.... top 50%...

Code: Select all

convert toes.png ( +clone -colorspace Gray -fuzz 50% -transparent Black ) -compose CopyOpacity -composite imgA.png

convert toes.png ( +clone -colorspace Gray -fuzz 50% +transparent Black ) -compose CopyOpacity -composite imgB.png