Problem using -composite operator in 6.2.9.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.
Locked
User avatar
magick
Site Admin
Posts: 11254
Joined: 2003-05-31T11:32:55-07:00

Problem using -composite operator in 6.2.9.5

Post by magick »

John Green says: I run IM under Gentoo Linux. With IM 6.2.8.0, the following worked as
required.

Code: Select all

convert \
\( -size 75x60 xc:yellow \) \
\( -size 63x60 xc:blue \) \
\( -size 63x60 xc:black -fill white -draw \
'ellipse 30,32 30,24 0,360' -blur 2x2 +matte \) \
-geometry +7+1 -composite image.png
Under 6.2.9.5, the infilled blue area has the wrong shape.

Should this sequence still work?

Thanks,

John Green

User avatar
magick
Site Admin
Posts: 11254
Joined: 2003-05-31T11:32:55-07:00

Post by magick »

Anthony discovered a bug in the clipping algorithm and the patch requires a slight change in your command line to apply the composite clip mask properly. Try this:
  • convert \
    \( -size 75x60 xc:yellow \) \
    \( -size 63x60 xc:blue \) \
    \( -size 75x60 xc:black -fill white -draw \
    'translate 7,1 ellipse 30,32 30,24 0,360' -blur 2x2 +matte \) \
    -geometry +7+1 -composite image.png
to get the same results as ImageMagick 6.2.8.0. This may only work properly with the very latest 6.2.9-7 Beta available tommorrow. 6.2.9-7 will be released within a week or two.

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

Post by anthony »

The problem is not so much a bug, but a fact.

The mask is definae relative to the background or destination image.

Also geometry offsets only defines the position of the source or overlay image, it does not effect the mask, and SHOULD NOT CHANGE.

Think of the mask as defining what parts of the destination is in the 'background'
the overlay that is masked is in front of the background, but behind the foreground parts of the destination.

In your case you want the mask to be relative to the source or overlay image, not te background. Currently their is no way of specifing this, other than by adjusting things yourself.

For details see IM Examples, Composite Masking.
http://www.cit.gu.edu.au/~anthony/graph ... pose/#mask
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/

Locked