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

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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post by fmw42 »

Any new information on this? Can anyone verify it on their system?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post 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.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

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

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post by fmw42 »

Thanks. This seems to be fixed in both IM 6.9.4.5 Q16 and IM 7.0.1.7 Q16
Post Reply