Basic mask question
Posted: 2012-07-31T16:44:31-07:00
This is a newbie question. I searched first as much I could, but I am probably not getting the logic of ImageMagick yet...
I have two images, a RGB PNG file and a PNG with alpha mask, same size. I want to completely black out the parts of the first image not present in the mask. What's the most efficient way to do this? Do I need to first convert the PNG with alpha mask to one that is grayscale but doesn't have an alpha channel?
I tried things like
Convert <INPUTFILE> -mask <MASKFILE> -channel RGB -evaluate set 0 +channel <OUTPUTFILE>
or
Convert <INPUTFILE> -mask <MASKFILE> -fill black -draw "rectangle 0,0 599,599" <OUTPUTFILE>
These almost work, but the unprotected area merely gets much darker, doesn't turn black.
I have two images, a RGB PNG file and a PNG with alpha mask, same size. I want to completely black out the parts of the first image not present in the mask. What's the most efficient way to do this? Do I need to first convert the PNG with alpha mask to one that is grayscale but doesn't have an alpha channel?
I tried things like
Convert <INPUTFILE> -mask <MASKFILE> -channel RGB -evaluate set 0 +channel <OUTPUTFILE>
or
Convert <INPUTFILE> -mask <MASKFILE> -fill black -draw "rectangle 0,0 599,599" <OUTPUTFILE>
These almost work, but the unprotected area merely gets much darker, doesn't turn black.