Wand Python – Introduction and Installation
Imagemagick is a tool developed to convert images from one format to another. Due to a versatile range of image formats and its precise and simple working, it has a huge community support. We can get images from pdf files.
Wand is a binding developed for python by Imagemagick.wWand opens and manipulate images. Wand provides a large number of functions for image manipulation.
Uses of Wand Library:
1. Read/Write images of different formats
2. Converting images from one form to another
3. Scaling and Cropping
4. Add simple effects to image
5. Add Special effects to images
6. Transform images
7. Other color Enhancements
Wand can be easily installed by running
$ pip install Wand
in a terminal oR Command Prompt.
Installation on Linux:
we can install Wand in Linux by running the below command
sudo apt-get install libmagickwand-dev
If we need SVG, WMF, OpenEXR, DjVu, and Graphviz support we have to install libmagickcore5-extra as well, to install libmagickcore5-extra run,
sudo apt-get install libmagickcore5-extra
in your terminal.
Installation on Mac:
We can simply install wand by using brew command as below
brew install imagemagick
Installation on Windows:
You could build ImageMagick by yourself, but it requires a build toolchain like Visual Studio to compile it. The easiest way is simply downloading a prebuilt binary of ImageMagick for your architecture (win32 or win64). You can download it from here.
Below is a simple use case example of Wand library where we write python code to convert image from jpeg format to png
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course