Masking issue with 7.0.5

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
chaoscarnage
Posts: 93
Joined: 2012-12-31T15:56:29-07:00
Authentication code: 6789

Masking issue with 7.0.5

Post by chaoscarnage »

Just updated from 6.
We use this method of applying masks to images.

Code: Select all

convert blank.png img.png mask.png -composite img.png 
In 6 this worked great, in 7 the mask doesn't seem to be applied at all and the png also loses all transparency.
Is there a command that I need to add in 7 to get the default behavior from 6?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Masking issue with 7.0.5

Post by magick »

IMv7 has a reverse alpha from IMv6. Try

Code: Select all

convert blank.png img.png \( mask.png -negate \) -composite img.png
chaoscarnage
Posts: 93
Joined: 2012-12-31T15:56:29-07:00
Authentication code: 6789

Re: Masking issue with 7.0.5

Post by chaoscarnage »

Looks like that did the trick! Thanks a ton!
chaoscarnage
Posts: 93
Joined: 2012-12-31T15:56:29-07:00
Authentication code: 6789

Re: Masking issue with 7.0.5

Post by chaoscarnage »

I apologize but I appear to still have issues with partial masks.

When I apply a mask that's half black and half white It masks as you'd expect but the white part becomes entirely filled with black.

Any way to stop the white pixels from being filled in?
chaoscarnage
Posts: 93
Joined: 2012-12-31T15:56:29-07:00
Authentication code: 6789

Re: Masking issue with 7.0.5

Post by chaoscarnage »

using -read-mask and -compose CopyOpacity seemed to help.
Post Reply