Page 1 of 1

[SOLVED] Difference Image Masking and Feathering: fails

Posted: 2010-10-14T00:39:54-07:00
by jlpoole
I'm following the examples at http://www.imagemagick.org/Usage/channels/#mask_diff

I have a png photo, sluggo.png (354 pixels by 502 pixels, 72 dpi). Using sluggo.png, I created a layer in Photoshop and the drew an ellipse, feathering it 30 pixels. I inverted the ellipse, filled the inverted area (exterior of ellipse to the edges of the image) with black, and then exported the image to mask.png -- having the same dimensions and dots per inch as the image it was derived from: sluggo.png.

Goal: create an elliptically cropped image with transparency outside of the ellipse.

Here's the command I used based upon my study of the above link to the section titled "Difference Image Masking and Feathering". It is practically identical to the examples, yet I must be missing something very obvious as it did not produce the desired result:

Code: Select all

convert  sluggo.png mask.png +matte  -compose CopyOpacity -composite output.png
The command ran without incident.

the output.png was blank. I was expecting an oval like framing of sluggo. "Oh No!!!!"

sluggo.png
Image
mask.png
Image
output.png (blank white)
Image

Using ImageMagick for Windows on XP Pro SP 3:

Code: Select all

Version: ImageMagick 6.6.4-2 2010-09-14 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2010 ImageMagick Studio LLC
Features: OpenMP
What have I done wrong?

Re: Difference Image Masking and Feathering: fails

Posted: 2010-10-14T01:19:21-07:00
by jlpoole
Problem solved.

I think the problem was in the mask I created. I tried experimenting with creating masks on the fly, as in the examples, and they worked. So, I'm guessing the way I exported the mask from photoshop, e.g. using "Save" rather than exporting and making sure the transparency is activated, makes the difference.

Re: [SOLVED] Difference Image Masking and Feathering: fails

Posted: 2010-10-14T05:21:35-07:00
by anthony
More than likly the mask image contained an alpha channel.

See CopyOpacity Composition
http://www.imagemagick.org/Usage/compose/#copyopacity