Masking: A Seemingly Trivial Question

PerlMagick is an object-oriented Perl interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning PerlMagick.
Post Reply
theblackswan
Posts: 1
Joined: 2012-05-10T15:19:19-07:00
Authentication code: 13
Location: Mountain View, CA

Masking: A Seemingly Trivial Question

Post by theblackswan » 2012-05-10T15:36:08-07:00

New to the IM world, tried several hours replicating a simple ImageMagick command in PerlMagick, but to no avail, and am posting to get some help. I could not figure out the right set of params for Composite.

Code: Select all

convert orange1.jpg violet1.jpg text.jpg -composite compose-masked-1.png
The mask, text.jpg is a generated grayscale image, so Duff-Porter methods did not take the transparency into account- maybe I am also doing that wrong.

Also, my final aim is to preserve the opacity of text.jpg, make a mask from orange1.jpg, and then do several other things with it. If there is a way to do that without resorting to manipulating pixels, please guide me out!

And thanks to the wonderful people who created and maintain IM. I come from ML/NLP world, had no experience in Image Processing before, and IM alone will be able to handle all of my needs.

User avatar
anthony
Posts: 8877
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Masking: A Seemingly Trivial Question

Post by anthony » 2012-05-10T23:57:35-07:00

Yes you are using JPEG which has no alpha channel.. add a -alpha set before the -composite
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/

Post Reply