Page 1 of 1

Drawing lines using imagemagick

Posted: 2012-03-24T05:16:29-07:00
by iscripts
greetings everyone..

We have this application where we accept signatures from users and convert it into transparent png images which we then use for printing purposes. the web interface we are using is the wonderful signature pad by Thomas Bradley http://thomasjbradley.ca/lab/signature-pad/

it captures the movements of the mouse and sends it over to the backend php page as a json array of coordinates. each of these coordinates are then used to generate individual pixels it seems which together make up the final signature.

now coming to our issue, the script works just fine for low resolution images, but at higher resolutions, it creates many semi-transparent pixels in the final image which wont be accepted by the printing firm. so we ended up stripping those pixels, but this in turn distorted the image.

the gd function being used to draw the pixels is

Code: Select all

imagefilledpolygon
which is the corresponding function in imagemagick?

Re: Drawing lines using imagemagick

Posted: 2012-03-24T05:26:35-07:00
by Bonzo
I would think an example would be useful but you checkout Draw: http://www.imagemagick.org/script/comma ... s.php#draw

Re: Drawing lines using imagemagick

Posted: 2012-03-24T11:30:41-07:00
by fmw42
See http://www.imagemagick.org/Usage/draw/#primitives regarding drawing of polygons and polylines for example

Re: Drawing lines using imagemagick

Posted: 2012-03-25T19:10:38-07:00
by anthony
As well as SVG Paths
http://www.imagemagick.org/Usage/draw/#paths
which could be used to 'smooth out' the line (in some way).

Please report back your finding and say some example code.