Version 9 of TclMagick

Updated 2004-03-19 09:48:18

What: TclMagick

 Where: http://tclmagick.sourceforge.net
 Description: Tcl only interface to ImageMagick library.
        Will make use of ImageMagick's Wand-API.
        Provides a one to one mapping of the Wand API - requires no
        Tk to do image manipulation.
        Currently in beta state.
 Updated: 08/2003
 Contact: See web site

Rolf Schroedter provides this example of the extension:

 # Load the tclMagick module
 #
 load TclMagick.dll

 # Create wand & draw objects
 #
 set wand [magick::wand create]
 set draw [magick::draw create]

 # Load & enlarge a PNG
 #
 $wand ReadImage sample.png
 $wand ResizeImage 500 500 cubic
 # Draw a red "Tcl/Tk" rotated by 45<B0>
 #
 $draw push graph
     $draw SetStrokeWidth 1
     $draw SetStrokeColorString "red"
     $draw SetFillColorString "red"
     $draw SetFontSize 18
     $draw Annotation -97 170 "Tcl/Tk"
 $draw pop graph
 $draw Rotate -45

 $wand DrawImage $draw

 # Write the image in different file formats
 #
 $wand WriteImage sample.jpg
 $wand WriteImage sample.gif
 $wand WriteImage sample.pdf

 # Delete wand & draw objects
 #
 magick::draw delete $draw
 magick::wand delete $wand

This extension is tracking an unstable version of ImageMagick (CVS, basically). I have an updated version for the latest out of CVS that now also compiles on Linux. Hopefully, TclMagick will be included in ImageMagick itself at some point. - davidw


davidw: I am working on making code that will link the Tcl imagemagick code with Tk. Although of course you do not and should not need Tk to use the TclMagick extension! You don't need a display to process images.

... For now it's just going to be a command to transfer preexisting Tk images to preexisting ImageMagick "wand"'s, and vice versa. In the future, I'd like to allow for tighter integration ala Img.


elfring 2003-12-01 Would you like to get a canvas to work with the Wand API [L1 ]?


The TkMagick extension is also built with TclMagick, and you can use it to transfer Magick images to Tk images.


ES: This looks very useful, but I can't get the code! The suggested anonymous CVS command on the home page returns the following:

 cvs -d:pserver:[email protected]:/GraphicsMagick co TclMagick
 cvs checkout: warning: failed to open /home/edsuom/.cvspass for reading: No such file or directory
 cvs checkout: authorization failed: server cvs.graphicsmagick.org rejected access to /GraphicsMagick for user anonymous
 cvs checkout: used empty password; try "cvs login" with a real password

davidw: Oops, requires you to first run 'login' with password anonymous. The web page is updated now in any case, and I will remove these comments in a week or so.


Category Package | Category Graphics