Open Source Image Processing Libraries Tutorial


In this chapter , we are going to explore some of the free image processing libraries that are widely used and can be easily integrated in your project.

A list of some of the libraries that we are going to explore is listed below:

  1. ImageJ
  2. Fiji
  3. Commons Imaging
  4. ImageMagick
  5. Endrov
  6. LeadTools
  7. OpenCv


ImageJ is a public domain Java image processing program inspired by NIH Image for the Macintosh. It can display, edit, analyse, process, save and print 8-bit, 16-bit and 32-bit images.

Some of the basic features of ImageJ are listed below:

Sr.NoFeatures & Description
1Runs Everywhere
ImageJ is written in Java, which allows it to run on Linux, Mac OS X and Windows, in both 32-bit and 64-bit modes.
2Open Source
ImageJ and its Java source code are freely available and in the public domain. No license is required.
Use ImageJ as a image processing toolkit (class library) to develop applets, servlets or applications.
4Data Types
8-bit grayscale or indexed colour, 16-bit unsigned integer, 32-bit floating-point and RGB colour.
5File Formats
Open and save GIF, JPEG, BMP, PNG, PGM, FITS and ASCII. Open DICOM. Open TIFFs, GIFs, JPEGs, DICOMs and raw data using a URL.
Create rectangular, elliptical or irregular area selections. Create line and point selections.
7Image Enhancement
Supports smoothing, sharpening, edge detection, median filtering and thresholding on both 8-bit grayscale and RGB colour images.
8Colour Processing
Split a 32-bit colour image into RGB or HSV components. Merge 8-bit components into a colour image.


Fiji is an image processing package. It can be described as a distribution of ImageJ (and ImageJ2) together with Java, Java3D and a lot of plug-ins organized into a coherent menu structure. Fiji compares to ImageJ as Ubuntu compares to Linux.

Apart from the ImageJ basic features , some of the advanced features of Fiji are listed below:

Sr.NoFeatures & Description
1Registering 3D images
This involves Elastic Alignment and Montage,Feature Extraction,Image Stabilizer e.t.c.
2Segmenting images
It offers more then 35 types of segmentation.
3Useful keyboard short cuts
Fuji has a lot of keyboard short cuts.
Allow scripting with Macros, in JavaScript, in JRuby, in Jython, in Clojure. in Beanshell.
5Developing Plug-ins
Use the Script Editor to start developing plug-ins and then run the plug-ins.
6ImageJ Tricks
ImageJ is easy to use, but sometimes you wish for some function that is actually implemented, yet you do not know how to trigger.

Commons Imaging

Apache Commons Imaging, previously known as Apache Commons Sanselan, is a library that reads and writes a variety of image formats, including fast parsing of image info (size, colour space, ICC profile, e.t.c.) and meta data.

Some of the basic features of ImageJ are listed below:

Sr.NoFeatures & Description
Apache Commons Imaging is written in 100% pure Java. It will run on any JVM, and any platform, without modification.
2Image Formats
It reads and writes a wide variety of image formats, and supports some variations and encodings missed by all or most other libraries.
3MetaData support
It supports reading and writing a variety of meta data in a structured way, including EXIF meta data.
4Network Friendly
It is network-friendly. Commons Imaging will only read the data it needs, and caches what is read so that it isn't too heavy on the network.
5Easy to use
It is designed to be very easy to use. It has a simple, clean interface. Most operations are a single Imaging method call.
Commons Imaging aims to be transparent. There are no hidden buffers to dispose, no native memory to free, no background threads.
7Open Source
It is Free Software/Open Source. It is available under the Apache Software License.
8Color Conversions
The ColorConversions class offers methods to convert between the following color spaces: CIE-L*CH, CIE-L*ab, CIE-L*uv, CMY, CMYK, HSL, HSV, Hunter-Lab, RGB, XYZ and Yxy.


ImageMagick is a software suite to create, edit, compose, or convert bitmap images. It can read and write images in a variety of formats (over 100) including DPX, EXR, GIF, JPEG, JPEG-2000, PDF, PNG, Postscript, SVG, and TIFF. Use ImageMagick to resize, flip, mirror, rotate, distort, shear and transform images, adjust image colours, apply various special effects, or draw text, lines, polygons, ellipses and Bezier curve.

Some of the basic features of ImageMagick are listed below:

Sr.NoFeatures & Description
1Format conversion
Convert an image from one format to another (e.g. PNG to JPEG).
Resize, rotate, crop, flip or trim an image.
Render portions of an image invisible.
Add shapes or text to an image.
Add a border or frame to an image.
6Special effects
Blur, sharpen, threshold, or tint an image.
Create a GIF animation sequence from a group of images.
Overlap one image over another.
9Morphology of shapes
Extract features, describe shapes and recognize patterns in images.
10Encipher or decipher an image
Convert ordinary images into unintelligible gibberish and back again.


Endrov is a multi-purpose image analysis program. It is written independently and designed to address many of the shortcomings of other free software and many commercial packages.

Some of the basic features of Endrov are listed below:

Sr.NoFeatures & Description
1View data
View data, in 2D and 3D. Designed to handle complex 4D data schemes and unlimited number of channels, where each channel can have its own X,Y and Z resolution.
2Annotate your images
Annotate your images, automatically or by hand, to understand them and get statistics.
3Undo and Redo
Undo and Redo for all operations.
4Lazy Evaluation
Designed from the ground up to handle large image sets. Endrov uses lazy evaluation, a concept mostly available in research programming languages.
5Scripting language
Graphical scripting language, as well as traditional scripting.
Written in Java. Plug-in architecture allows easy extension with new Java plug-ins. Can interact with Matlab.
Access almost all commercial and open file formats using Bio-formats.
8Microscopic Processing
Control all your microscopes with one program. Do on-the-fly image analysis.


LEADTOOLS provides over 200 image processing functions in several categories including document cleanup, medical image enhancement, colour conversion and correction, noise reduction, edge detection and more.

Some of the basic features of LEADTOOLS are listed below:

Sr.NoFeatures & Description
1Scanned Document Image Processing
This powerful collection of functions can rid scanned documents of artefacts and imperfections such as hole punches, skewed angles, borders, dust speckles and more.
2Medical Image Processing
Enhance the image or highlight the details by shifting, selecting, subtracting and removing the background for better visuals.
3Geometric Transformation
These functions can be used to clean, align and correct images or apply artistic 3D effects.
4Brightness and Contrast
These functions can be used to enhance images, apply artistic effects or aid in diagnostic evaluation of medical images.
5Colour Space Conversion
Add image colour space functionality to single and multi-threaded applications including IIS and Windows WF hosted applications.
6Colour Correction
These functions can be used to correct images with swapped colour channels, balance colour intensities or perform various image analysis tasks.
7Image Enhancement
These functions can be used to correct common errors in photography such as red-eye and imbalanced colours as well as aid in diagnostic evaluation of medical images.
8Region of Interest
These functions can be used to create and modify regions of interest in images to perform image processing functions on specific portions of an image, save time in bar-code and OCR recognition or perform various image analysis tasks.


OpenCV is released under a BSD license and hence its free for both academic and commercial use. It has C++, C, Python and Java interfaces and supports Windows, Linux, Mac OS, iOS and Android. OpenCV was designed for computational efficiency and with a strong focus on real-time applications. Written in optimized C/C++, the library can take advantage of multi-core processing.

Some of the basic features of OpenCV are listed below:

Sr.NoFeatures & Description
1Smoothing Images
This involve applying Blur,GaussianBlur,medianBlur and bilateral Filter.
2Eroding and Dilating
Apply two very common morphology operators: Dilation and Erosion.
3Morphology Transformations
OpenCV function morphologyEx to apply Morphological Transformation such as opening, closing,TopHat and BlackHat e.t.c.
4Image Pyramids
OpenCV functions pyrUp and pyrDown to down sample or up sample a given image.
4Basic Thresholding Operations
Perform basic thresholding operations using OpenCV function threshold.
5Adding borders to your images
OpenCV function copyMakeBorder is used to set the borders (extra padding to your image).
In OpenCV, the function remap offers a simple remapping implementation.
8Histogram Calculation
For simple purposes, OpenCV implements the function calcHist, which calculates the histogram of a set of arrays (usually images or image planes). It can operate with up to 32 dimensions.