Page 1 of 1

Explain Masking

Posted: 2010-08-22T12:21:39-07:00
by walzmyn
Can someone please explain to me how to use the masking technique? I am posting in the PerlMagick board because that's the medium I'm usually using, but I'd appreciate help via CLI or Perl.
I have read everything on the website and looked though all the examples and melted on Google server looking for information and still just do not understand how this mask thing works.

Here's what I would eventually like to do. (Well, the first of many) Annotate an image, then use the text from that image as a mask, composite that text onto a second image and use it to cut a transparent hole in the second image.

At least I think using a mask is the proper way to do this. Right now I'm making the text white and compositing it onto an image I know has no white, then turning everything white transparent. This has it's issues though and I'd prefer to do it "right".

Thanks in advance.

Re: Explain Masking

Posted: 2010-08-22T13:20:16-07:00
by el_supremo
This illustrates how to use a mask from the command line. You can change the mask to be your text.
http://www.imagemagick.org/Usage/channe ... ed_compose

This is my translation of the above command line into C which might help you with writing it in Perl.
http://members.shaw.ca/el.supremo/Magic ... yclops.htm

Pete