Chapter 1: Introduction to Magick++
I have been preparing programs that demonstrate the various capabilities of Magick++. I am planning to prepare them as a set of articles that would demonstrate how Magick++ could be integrated in to your C++ program, thus providing an immense power in manipulating images. In this tutorial, I would introduce some of the basics of Magick++ and in the next tutorial, we will discuss methods to compile a Magick++ program. Subsequently, we would prepare simple programs and with advanced features appearing as we progress.
What is ImageMagick API? ImageMagick is a software suite for reading, writing and manipulating images in command line. It is also built-in with APIs in many different programming languages like Ada, C, C++, .NET, Java, PHP, Ruby etc. These APIs allow production of complex image processing operation and a better integration in to programs than command line tools. The various APIs available are listed below along with their programming language. Programming language Ada C Ch COM+ C++ Java LabView Lisp .NET Pascal Perl PHP PHP Phyton Ruby Tcl/Tk API G2F MagickWand ChMagick ImageMagickObject Magick++ JMagick LVOOP ImageMagick CL-Magick MagickNet PascalMagick PerlMagick MagickWand for PHP Imagick PhytonMagick RMagick TclMagick
Why ImageMagick API? Even though the information given below was discussed in one of my previous article, for sake of completeness, I would like to discuss the reasons for existence of ImageMagick API like Magick++.
1. Command line tools do not lend themselves to large programs. 2. The number of file formats are finite and definitely only a few of them are used universally. But the number of image processing operations are infinite as the individual operations can be mixed and matched. Hence, the programmer needs flexibility in creating their own image processing routines. ImageMagick fills this gap by providing APIs. 3. APIs also allow access to the individual pixels in an image and hence can perform low level image processing operations as well. 4. Two people are not alike and definitely two programmers are not alike. So, ImageMagick provides a multiple choice for programming environment. A Java developer need not be constrained to use C++ for his image processing operations. 5. This also allows ImageMagick to be used in different environment, a) Desktop applications using C, C++, LabView, Pascal and Tcl/Tk b) Internet based applications using COM+, Java, .NET, PHP, Python and Ruby
Magick++ Magick++ is a set of C++ class that allows reading, writing and manipulating images from various file formats. Specifically, Magick++ provides 11 major classes to perform these functions. These classes allow 1. Reading and writing images 2. User to create new images 3. Create vector graphics like circle, lines etc in an image 4. Provide ability to manipulate the pixel values in an image 5. Perform image processing operations on the image like filtering, segmentation etc
Magick++ like ImageMagick can be used with almost all major operating systems like Windows, MacOSX, *nix etc. ImageMagick and Magick++ are released under a license compatible with GPL and hence provides free usage for personal and commercial purpose. It
prohibits redistribution of code without prior attribution. Magick++ can be used as a standalone program for your image processing need or can be combined with other libraries to create commercial grade applications. All the subsequent article were written with ImageMagick and Magick++ version 6.2.5 and compiled using the c++ compiler under Linux. So far, we have discussed the basics of Magick++. In the next chapter, we will look at the basics of a Magick++ program and methods for compiling the code. We will specifically focus on parts of the program that needs to be included for successful compilation, methods to link the Magick++ libraries etc.