Python bindings for the ImageMagick MagickWand API.
The MagickWand API is the recommended interface between the C programming language and the ImageMagick image processing libraries. This package provides bindings for the Python language.
magick_wand = NewMagickWand()
MagickReadImage(magick_wand, 'rose.jpg')
if not MagickFlipImage(magick_wand):
raise WandException(magick_wand)
MagickWriteImage(magick_wand, "result.jpg")
magick_wand = NewMagickWand()
MagickReadImage(magick_wand, 'rose.jpg')
drawing_wand=NewDrawingWand()
DrawSetFont(drawing_wand, "/usr/share/fonts/bitstream-vera/Vera.ttf")
DrawSetFontSize(drawing_wand, 20)
DrawSetGravity(drawing_wand, CenterGravity)
pixel_wand = NewPixelWand()
PixelSetColor(pixel_wand, "white")
DrawSetFillColor(drawing_wand, pixel_wand)
if not MagickAnnotateImage(magick_wand, drawing_wand, 0, 0, 0, "Rose") != 0:
raise WandException(magick_wand)
MagickWriteImage(magick_wand, "result.jpg")
More samples are available in the samples directory.
The MagickWand API is available in various versions:
ImageMagick | MagickWand | Status |
6.4 | 1 | not generated |
6.5 | 2 | not generated |
6.6 | 3 | supported |
6.7.0 | 4 | supported |
6.7.2 | 5 | supported |
The GraphicsMagick Wand API was forked from ImageMagick in August 2003. It lacks features that are available in newer versions and therefore, it is currently not supported here. Though, as GraphicsMagick focuses on a stable API, it would be nice to have support for it. Your contribution is highly welcome.
There are various other bindings and abstractions for ImageMagick, here is an onverview:
PythonMagick ------- 0.3 -- 0.4 -- 0.5 ---------------- 0.7 --------- 0.8 --------- 0.9.7 \ PythonMagickWand/Achim Domma ---------------------- 0.2 --------- r107 PythonMagickWand/Ian Stevens * ---- r42 -- r53 \ python-magickwand/Benjamin Schweizer 2009 -------- 2011 - 2012 \ python-magickwand/Oliver Berger 0.2 Wand 0.1 -- 0.1.9 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012
PythonMagick is the oldest wrapper for the ImageMagick API. It is a C++ extension based on the Boost Library and thus, requires compilation on OS-level.
Achim Domma stated on PythonMagick that is is too hard to maintain and started a CDLL-based re-implementation of the MagickWand API. This version includes a custom API generator based on gccxml. Though, it was abandoned in 2008.
Ian Stevens and Victor Ng started PythonMagickWand. PythonMagickWand aims to provide an object-oriented API that is structured to be more pythonic. Their implementation uses h2xml and xml2py for MagickWand API generation. It introduced the Image, Color and MagickWand classes that later influened the MagickFoo and Wand APIs.
There are two forks, one by Benjamin Schweizer named python-magickwand and a fork thereof by Oliver Berger named python-magickwand-0.2. The first is a direct predecessor of this source tree, the latter was abandoned in 2010.
MagickFoo is an updated version of Ian Steven's PythonMagickWand API. It is included in python-magickwand.
Wand is a new CDLL-based abstraction by Hong Minhee. It was inspired by Ian Steven's PythonMagickWand API. As of 2012, the project is in active develop ment with regular github commits.
- Benjamin Schweizer, http://benjamin-schweizer.de/contact
- Ian Stevens, http://crazedmonkey.com/
- Victor Ng, http://www.monkeybeanonline.com/
- generate bindings for magickwand-1 and magickwand-2
- re-enable win32 support