I wish to make part (or in fact, several parts) of an image transparent using IMagick, such that I can use it as a mask over a different image. I can't figure out any way of doing this in an simple fashion.
So say my starting image is represented as below, where X is any color:
XXXXXXXXXXXXX
XXXXXXXXXXXXX
XXXXXXXXXXXXX
XXXXXXXXXXXXX
XXXXXXXXXXXXX
Then I want to be able to make certain rectangular regions transparent (so it ends up a bit like a punch-card):
XXXXXXXXXXXXX
X XXXXXXXXXX
X XXXX XXXX
XXXXXXX XXXX
XXXXXXXXXXXXX
Does anyone know of a good way of doing this? Thanks.