Page 1 of 1

Polyline draw produces unexpected results.

Posted: 2015-02-24T08:04:47-07:00
by richerm

Code: Select all

convert -size 250x250 xc:#FFFFFF -stroke red -fill none -strokewidth 5 -draw "polyline 100,100 200,100 200,200 100,200 100,100"  "Output.png"
This produces a perfect square in red (as expected).

Code: Select all

convert.exe -size 250x250 xc:#FFFFFF -stroke red -fill none -strokewidth 5 -draw "polyline 100,100 200,100 100,100"  "Output.png"
I then attempt to draw the top line of the rectangle then go back to the start of the line. I was expecting the result of a single red line, but instead I got a weird X pattern produced.

Code: Select all

convert -size 250x250 xc:#FFFFFF -stroke red -fill none -strokewidth 5 -draw "polyline 100,100 200,100 200,200 100,200 100,100 100,100 200,100 200,200 100,200 100,100"  "Output.png"

Code: Select all

convert.exe -size 400x400 xc:#FFFFFF -stroke "rgba(255,0,0,1.00)" -fill none -strokewidth 5 -draw "polyline 100,100 200,100 200,200 100,200 100,100 100,200 200,200 200,100 100,100"  "Output.png"
Interestingly enough, if I draw the rectangle twice, in the same direction I do not get this result. But if I draw once in one direction then back in the other I get a different result. Thoughts?

Version: ImageMagick 6.9.0-7 Q16 x86 2015-02-18

Re: Polyline draw produces unexpected results.

Posted: 2015-02-24T08:35:08-07:00
by Bonzo
In your bottom two examples I can see you have nine sets of coordinates in one command and ten in the other. One command has 100,100 twice have you tried removing one of the 100,100 or adding an extra set of coordinates to the other command?

Re: Polyline draw produces unexpected results.

Posted: 2015-02-24T08:40:07-07:00
by richerm
Good catch, that was a bad copy/paste on my part, as this is a skimmed down version of the real issue I'm facing (the polyline is hand drawn so coordinates can be confusing so I simplified it).

Below are the two updated commands ( same results - one that makes sense, another with a 'glitch' ).

Code: Select all

convert.exe -size 250x250 xc:#FFFFFF -stroke "rgba(255,0,0,1.00)" -fill none -strokewidth 5 -draw "polyline 100,100 200,100 200,200 100,200 100,100 200,100 200,200 100,200 100,100"  "Output.png"

convert.exe -size 250x250 xc:#FFFFFF -stroke "rgba(255,0,0,1.00)" -fill none -strokewidth 5 -draw "polyline 100,100 200,100 200,200 100,200 100,100 100,200 200,200 200,100 100,100"  "Output.png"