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.
An RMagick user reports a difference between compositing using DrawImage and compositing using CompositeImage. I've reproduced it using plain ImageMagick commands. This is 6.4.4 on 64-bit Ubuntu.
Here's the input image:
This convert command produces the image shown below. I enlarged it 8x for clarity:
The draw command uses DrawAffineImage() rather than CompositeImage(), however, we did find an off-by-one error which is fixed in the ImageMagick Subversion trunk available sometime tomorrow. Thanks.
rmagick wrote:An RMagick user reports a difference between compositing using DrawImage and compositing using CompositeImage. I've reproduced it using plain ImageMagick commands. This is 6.4.4 on 64-bit Ubuntu.
Here's the input image:
This convert command produces the image shown below. I enlarged it 8x for clarity:
composite priority_07.png -gravity center -size 40x40 xc:white -resize 800% good-compose.png
Strange, but resulting image names seems opposite to me. The draw seems to make a good result and the composite seems to be clipping the edges in some way. Was this a typo or am I missing something?
I installed 6.4.5-3 and gave it a try. Here's the new output from -draw image (DrawAffineImage):
This is much better but it's not my place to say if it's sufficient. I'll let you know if the RMagick user has any questions or comments. (Or he might choose to post here directly.)
I do think that the output from the composite command is superior. For reference, on the left is the original priority_07.png enlarged 800% with GIMP and overlaid onto a white background. On the right is the output from the composite command.
Thanks again for the quick turnaround. (It's not quite 7 hours since my original post. Not too shabby!)
We need to use DrawAffineImage() in the -draw option because it supports the -affine option to rotate / shear / translate the image. We would not expect the results to perfectly match that of CompositeImage().
I think the problem may be the virtual pixel leaking into the draw affine. Try setting -virtual-pixel white and seeing if the result is better.
Remember the default -virtual-pixel setting is 'edge' and that must NOT change as it is vital to the default handling of simple operations such as blur.
No the above result looks good. I was thinking of the other previous results, which had what looked like there were extra 'clipped' circles on the very edge.