Skip to content
This repository has been archived by the owner on May 12, 2020. It is now read-only.

benschweizer/python-magickwand

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

python-magickwand

Python bindings for the ImageMagick MagickWand API.

About

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.

Examples

flip

magick_wand = NewMagickWand()
MagickReadImage(magick_wand, 'rose.jpg')
if not MagickFlipImage(magick_wand):
    raise WandException(magick_wand)
MagickWriteImage(magick_wand, "result.jpg")

annotate

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.

Compatibility

API Versions

The MagickWand API is available in various versions:

ImageMagickMagickWandStatus
6.41not generated
6.52not generated
6.63supported
6.7.04supported
6.7.25supported

GraphicsMagick

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.

Alternatives

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

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.

PythonMagickWand/Achim Domma

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.

PythonMagickWand/Ian Stevens

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

MagickFoo is an updated version of Ian Steven's PythonMagickWand API. It is included in python-magickwand.

Wand/Hong Minhee

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.

Authors

Todo

  • generate bindings for magickwand-1 and magickwand-2
  • re-enable win32 support

About

Python bindings for the ImageMagick MagickWand API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages