Page 1 of 1

possible bug stroke offset with -annotate and -gravity IM 6.9.3.10 Q16 Mac OSX

Posted: 2016-05-05T15:58:41-07:00
by fmw42
.

If one uses two different stroke colors and widths with -annotate, they offset differently unless -gravity is northwest


Gravity Southeast: worst

Code: Select all

text="Some Sample Text"
convert -size 581x153 xc:gray -font arial -gravity southeast -pointsize 64 \
-stroke black -strokewidth 4 -annotate +10+5 "${text}" \
-stroke white -strokewidth 1 -fill white -annotate +10+5 "${text}" \
"out1.jpg"
Image


Gravity Center: still bad

Code: Select all

text="Some Sample Text"
convert -size 581x153 xc:gray -font arial -gravity center -pointsize 64 \
-stroke black -strokewidth 4 -annotate +10+5 "${text}" \
-stroke white -strokewidth 1 -fill white -annotate +10+5 "${text}" \
"out2.jpg"
Image


Gravity Northwest: fine

Code: Select all

text="Some Sample Text"
convert -size 581x153 xc:gray -font arial -gravity northwest -pointsize 64 \
-stroke black -strokewidth 4 -annotate +10+5 "${text}" \
-stroke white -strokewidth 1 -fill white -annotate +10+5 "${text}" \
"out3.jpg"
Image

Re: possible bug stroke offset with -annotate and -gravity IM 6.9.3.10 Q16 Mac OSX

Posted: 2016-05-12T18:33:11-07:00
by fmw42
Any new information on this? Can anyone verify it on their system?

Re: possible bug stroke offset with -annotate and -gravity IM 6.9.3.10 Q16 Mac OSX

Posted: 2016-05-12T18:47:47-07:00
by snibgo
I get the same results, with IM v6.9.2-5 on Windows 8.1.

I have noticed this weird behaviour when I use stroke with annotate. The wider the stroke is made, the more the inside of the characters shift to the left. They shift left to the amount that makes the right-side edge of the stroke stay in the same place. It's a kind of "right-justification".

This happens only for some gravities, and the shift is always leftwards. Never rightwards or up or down. Thus, I couldn't see any reason for the behaviour.

To me, the more sensible (predictable) behaviour would be that increasing a stroke width never moves characters left, right up or down.

Re: possible bug stroke offset with -annotate and -gravity IM 6.9.3.10 Q16 Mac OSX

Posted: 2016-05-24T15:21:47-07:00
by fmw42
Has this been addressed? It still seems to fail on IM 6.9.4.4 and IM 7.0.1-6, though there seems to be a changelog entry about

2016-05-20 7.0.1-6 Cristy <quetzlzacatenango@image...>
Fixed proper placement of text annotation for east / west gravity.

Re: possible bug stroke offset with -annotate and -gravity IM 6.9.3.10 Q16 Mac OSX

Posted: 2016-05-24T16:16:50-07:00
by magick
Thanks for the problem report. We can reproduce it and will have a patch to fix it in GIT master branch @ https://github.com/ImageMagick/ImageMagick later today. The patch will be available in the beta releases of ImageMagick @ http://www.imagemagick.org/download/beta/ by sometime tomorrow.

Re: possible bug stroke offset with -annotate and -gravity IM 6.9.3.10 Q16 Mac OSX

Posted: 2016-05-30T16:24:27-07:00
by fmw42
Thanks. This seems to be fixed in both IM 6.9.4.5 Q16 and IM 7.0.1.7 Q16