Wand¶
Wand is a ctypes
-based simple ImageMagick binding for Python.
from wand.image import Image
from wand.display import display
with Image(filename='mona-lisa.png') as img:
print(img.size)
for r in 1, 2, 3:
with img.clone() as i:
i.resize(int(i.width * r * 0.25), int(i.height * r * 0.25))
i.rotate(90 * r)
i.save(filename='mona-lisa-{0}.png'.format(r))
display(i)
You can install it from PyPI (and it requires MagickWand library):
$ apt-get install libmagickwand-dev
$ pip install Wand
Why just another binding?¶
There are already many MagickWand API bindings for Python, however they are lacking something we need:
Pythonic and modern interfaces
Good documentation
Binding through
ctypes
(not C API) — we are ready to go PyPy!Installation using pip
Requirements¶
Python 2.7 or higher
CPython 2.7 or higher
CPython 3.3 or higher
PyPy 1.5 or higher
MagickWand library
libmagickwand-dev
for APT on Debian/Ubuntuimagemagick
for MacPorts/Homebrew on MacImageMagick-devel
for Yum on CentOS
User’s guide¶
- What’s new in Wand 0.6?
- Installation
- Install ImageMagick on Debian/Ubuntu
- Install ImageMagick on Fedora/CentOS
- Install ImageMagick on Mac
- Install ImageMagick on Windows
- Explicitly link to specific ImageMagick
- Explicitly define ImageMagick library suffix
- Install Wand on Debian/Ubuntu
- Install Wand on Fedora
- Install Wand on FreeBSD
- Install Wand on Alpine
- Security
- Reading images
- Writing images
- Resizing and cropping
- Image Effects
- Special Effects (FX)
- Transformation
- Colorspace
- Color Enhancement
- Distortion
- Drawing
- Reading EXIF
- Layers
- Montage
- Morphology
- Sequence
- Resource management
- Quantize
- Threshold
- CLI Reference
- Running tests
- Roadmap
- Wand Changelog
- Talks and Presentations
References¶
wand
— Simple MagickWand API binding for Pythonwand.image
— Image objectswand.color
— Colorswand.font
— Fontswand.drawing
— Drawingswand.sequence
— Sequenceswand.resource
— Global resource managementwand.exceptions
— Errors and warningswand.api
— Low-level interfaceswand.compat
— Compatibility layerwand.display
— Displaying imageswand.version
— Version data
Troubleshooting¶
Stack Overflow¶
There’s a Stack Overflow tag for Wand:
http://stackoverflow.com/questions/tagged/wand
Freely ask questions about Wand including troubleshooting.
Thanks to everyone in the Stack Overflow community for contributions.
Documentation¶
The documentation for Wand is hosted by ReadTheDocs.org. The nightly development docs can be found under the latest version, and the most recent release under stable. Previous & maintenance releases are also available.
Open source¶
Wand is an open source software initially written by Hong Minhee (for StyleShare), and is currently maintained by E. McConville. See also the complete list of contributors as well. The source code is distributed under MIT license and you can find it at GitHub repository. Check out now:
$ git clone git://github.com/emcconville/wand.git
If you find a bug, please notify to our issue tracker. Pull requests are always welcome!
Check out Wand Changelog also.