Open CollinHeist opened 1 year ago
You have IM v7. The usual command for that is magick
. But you use convert
which uses the very old v6 syntax, and is provided for backwards compatability. The v7 syntax is better. I suggest using magick
. (And not "magick convert
" which would also use v6 syntax.)
On -gravity
, see https://imagemagick.org/script/command-line-options.php#gravity :
Only the text primitive of -draw is affected by the -gravity option.
So the path is not affected by gravity.
For testing, I suggest you use a solid background like xc:Blue
. A transparent background makes it hard to see what is happening.
Does that answer the question?
Sorry I wasn't clear - my question was not why gravity wasn't affecting the draw, it was why the annotate repositioning (45x45+25+25
in my example) were affecting the draw path.
For reference, using the IM7 magick
command creates this:
While the convert
command creates this:
This doesn't seem right, as I wouldn't expect the rotation and translation to carry over. If it is intended, is there a way to reset these surface adjustments?
The rotation from -annotate
should not be carried forward to the -draw
. V6 convert
and v7 magick
should give the same result, but they don't. This seems to be a bug in v6. For example, where I have removed "-gravity Center
" for simplicity:
With IM 6.9.12-72:
convert -size 500x500 xc:Blue -pointsize 50 -fill crimson -annotate 45x45+25+25 "test" -draw "translate 250,250 path 'M -25 -25 l 50,0 0,50 -50,0 0,-50'" out6.png
With IM v7.1.0-62, but using v6 syntax:
magick convert -size 500x500 xc:Blue -pointsize 50 -fill crimson -annotate 45x45+25+25 "test" -draw "translate 250,250 path 'M -25 -25 l 50,0 0,50 -50,0 0,-50'" out7b.png
With IM v7.1.0-62, using v7 syntax:
magick -size 500x500 xc:Blue -pointsize 50 -fill crimson -annotate 45x45+25+25 "test" -draw "translate 250,250 path 'M -25 -25 l 50,0 0,50 -50,0 0,-50'" out7.png
The only correct result is the last one.
ImageMagick version
7.1.1-10
Operating system
MacOS
Operating system, version and so on
MacOS Ventura 13.2
Description
Translations with
-annotate
will affect subsequent-draw
commands. I could not find anywhere that this is intended, nor how to reset these translations.Steps to Reproduce
-annotate
, and the offset is adjusted as well.Images