Overlaying a strokewidth=0 on a strokewidth=20 is properly centered vertically but not horizontally. It is off by half the strokewidth.
Is this a bug?
# get optimal size
size=`convert -background none -font Tahoma -fill red -pointsize 100 -stroke red -strokewidth 20 label:"Test text" -format "%wx%h" info:`
# This fails to center properly horizontally
convert -size $size xc:none \
-gravity center -font Tahoma -fill red -pointsize 100 -stroke red -strokewidth 20 -annotate +0+0 "Test text" \
-gravity center -font Tahoma -fill white -pointsize 100 -stroke white -strokewidth 0 -annotate +0+0 "Test text" result1.png
convert -size $size xc:none \
-gravity center -font Tahoma -fill red -pointsize 100 -stroke red -strokewidth 20 -annotate +0+0 "Test text" \
-gravity center -font Tahoma -fill white -pointsize 100 -stroke white -strokewidth 0 -annotate -10+0 "Test text" result2.png
possible bug stroke/strokewidth IM 6.9.1.2 Q16 Mac OSX
Re: possible bug stroke/strokewidth IM 6.9.1.2 Q16 Mac OSX
This does look like a bug to me. When you make the background xc:green instead of xc:none you will notice that the red text is not centered. I think the text should be centered. Maybe magick can tell us if this is by design?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: possible bug stroke/strokewidth IM 6.9.1.2 Q16 Mac OSX
This issue does not seem to have been resolved yet in 6.9.1.3 beta. As far as I can tell, it still has an offset.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: possible bug stroke/strokewidth IM 6.9.1.2 Q16 Mac OSX
This issue does not seem to have been resolved in recently released 6.9.1.3. As far as I can tell, it still has an offset.
Re: possible bug stroke/strokewidth IM 6.9.1.2 Q16 Mac OSX
We can reproduce the problem you posted and have a patch in ImageMagick 6.9.1-4 Beta, available by sometime tomorrow. Thanks.