How to Build ImageMagick for Software Distribution on Windows

If you have read the article How to Benchmark Barcode SDK Performance – ZXing vs ZBar, you may have noticed that ZBar relies on ImageMagick. ImageMagick is an open source software suite that capable of reading a variety of images. If you just want to write a barcode testing program, Windows Binary Release of ImageMagick is enough. However, if you consider distributing your applications, the Windows binary distribution is not suitable. Why? I’ll show you in the following content.

ImageMagick DLL Dependencies on Windows

When opening the ImageMagick installation directory, you will see the following dynamic libraries:
ImageMagick dependencies

Do you think all ZBar-dependent dynamic libraries are here? No! If you pack Jar package with these DLLs and send it to someone’s PC that has no ImageMagick installed, the program will throw exceptions of loading DLL. The reason is when running the program on your operating system, ImageMagick will read its installation directory from Registry Editor and dynamically load some modules:

ImageMagick modules

To distribute ImageMagick libraries, you’d better build it yourself.

How to Build the Source Code of ImageMagick

Visit to download

Find ImageMagick-6.9.2-0 > VisualMagick > configure > configure.exe:

ImageMagick configure

Run configure.exe and select Static Multi-threaded runtimes:

ImageMagick static multi-threaded runtimes

Click Next to generate Visual Studio solution file. Import the project to Visual Studio 2013, and then check all projects named with CORE_:

ImageMagick core libs

Build the project to generate static libs:
ImageMagick static libs

Open JNI project and change the Runtime Library to Multi-threaded (/MT):


Link the static libraries of ImageMagick to your JNI dynamic library, and then you can pack the following files for distribution:

java barcode program