units for Draw's strokewidth?

PerlMagick is an object-oriented Perl interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning PerlMagick.
Post Reply
Chelmite
Posts: 3
Joined: 2004-01-29T23:04:08-07:00

units for Draw's strokewidth?

Post 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.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: units for Draw's strokewidth?

Post 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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply