Drawing lines using imagemagick

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
iscripts
Posts: 6
Joined: 2011-10-20T22:14:23-07:00
Authentication code: 8675308

Drawing lines using imagemagick

Post 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?
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Drawing lines using imagemagick

Post by Bonzo »

I would think an example would be useful but you checkout Draw: http://www.imagemagick.org/script/comma ... s.php#draw
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Drawing lines using imagemagick

Post by fmw42 »

See http://www.imagemagick.org/Usage/draw/#primitives regarding drawing of polygons and polylines for example
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Drawing lines using imagemagick

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