JMagick Tutorial


JMagick Tutorial

Learn how to download, install and create simple JMagick program through this tutorial.

Learn how to download, install and create simple JMagick program through this tutorial.

JMagick Tutorial - Download, install and create simple program

JMagick library is Java library for handling the image in Java. It is implemented as thin Java Native Interface (JNI) layer to access the popular ImageMagick API. The ImageMagick API is written is C programming language. It is one of the most popular image handling library. ImageMagick  can be used to resize the image. It can also use to flip, mirror, rotate and even distort the input image. Beside these functionality it can also be used to shear and transform images.

Its import function includes adjustment of image colors, apply various special effects, or draw text etc... JMagick library allows you to perform these activity from the Java code also. In this tutorial I will teach you how you can use the JMagick library for manipulating the images.

Downloading and installing JMagick on windows

Step 1:  To Download the JMagick for windows operating system visit

Step 2: Download the file ImageMagick-6.3.9-0-Q16-windows-dll.exe and install on your computer. Add the installation path in the patch variable of your computer.

Step 3: Download and unzip. The directory contains jmagick.jar and jmagick.dll.

Step 4: Add jmagick.jar is in the Java classpath.

Step 5: Copy jmagick.dll into jre\bin and JDK\lib directories

Now you can compile and run your program based on JMagick.

Example of JMagick that writes text on the image.

Blow is the program that writes the text on the image:

import java.awt.*;
import magick.*;

class InsertText
	public static void main(String a[]) throws IOException,MagickException
		ImageInfo info=new ImageInfo("test.jpg");
		MagickImage image=new MagickImage(info);
		DrawInfo aInfo = new DrawInfo(info);


		aInfo.setText("JMagick Tutorial");



In this tutorial you have learned how to download, install and create simple program using JMagick library.