Page 1 of 1

units for Draw's strokewidth?

Posted: 2007-07-06T13:40:39-07:00
by Chelmite
What are the units for the Draw method's strokewidth parameter?
pixels? points? inches? percent? mm? cm?
The documentation lists it as "float", which tells the form, but none of the semantics.

Oddly, strokewidth is defined as float for: Draw and integer for: Annotate and Polaroid. But none of these methods define the semantics of this parameter.

Re: units for Draw's strokewidth?

Posted: 2007-07-12T00:54:20-07:00
by anthony
Actually it should be float always. Units are in pixels.

Considering the 'freeform' of perl varibles, it is probably only a documentation error.

try drawing with some stroke widths of say 2.5 and compare with images of stroke width 2 and 3, to verify it is float. Then report a bug in the bugs forum for documentation fix.

Hmm just a quick change form commandline...
2.5 vs 2 output to my X display

Code: Select all

    convert -pointsize 72 -stroke black -fill white \
           -strokewidth 2.5  label:'Anthony' \
           -strokewidth 2 label:'Anthony' \
           -compose difference -composite x:
2.5 vs 3

Code: Select all

    convert -pointsize 72 -stroke black -fill white \
           -strokewidth 2.5  label:'Anthony' \
           -strokewidth 3 label:'Anthony' \
           -compose difference -composite x:
Yeap the freetype font library does handle floating point stroke width. You check with PerlMagick, and report a bug if it doesn't, or a bug in documentation if it does handle floating point.

NOTE IM does not handle floating point positions for fonts...

Code: Select all

  convert -pointsize 72 -size 320x100 \
          xc: -annotate +30+70 'Anthony' \
          \( xc: -annotate +30.2+70.2 'Anthony' \) \
          -compose difference -composite x:
results in black.
I do not know if this is is an artifact of IM's argument handling (a bug), or the use of the freetype font library (a bug in that library), Repeating this with -draw text produces the same result.