What is the best java image processing library/approach? [closed]

Posted on

Problem :

I am using both the JAI media apis and ImageMagick?

ImageMagick has some scalability issues and the JNI based JMagick isn’t attractive either.
JAI has poor quality results when doing resizing operations compared to ImageMagick.

Does anyone know of any excellent tools either open source or commercial that are native java and deliver high quality results?

Solution :

I know this question is quite old, but as new software comes out it does help to get some new links to projects that might be interesting for folks.

imgscalr is pure-Java image resizing (and simple ops like padding, cropping, rotating, brighten/dimming, etc.) library that is painfully simple to use – a single class consists of a set of simple graphics operations all defined as static methods that you pass an image and get back a result.

The most basic example of using the library would look like this:

BufferedImage thumbnail = Scalr.resize(image, 150);

And a more typical usage to generate image thumbnails using a few quality tweaks and the like might look like this:

import static org.imgscalr.Scalr.*;

public static BufferedImage createThumbnail(BufferedImage img) {
    // Create quickly, then smooth and brighten it.
    img = resize(img, Method.SPEED, 125, OP_ANTIALIAS, OP_BRIGHTER);

    // Let's add a little border before we return result.
    return pad(img, 4);

All image-processing operations use the raw Java2D pipeline (which is hardware accelerated on major platforms) and won’t introduce the pain of calling out via JNI like library contention in your code.

imgscalr has also been deployed in large-scale productions in quite a few places – the inclusion of the AsyncScalr class makes it a perfect drop-in for any server-side image processing.

There are numerous tweaks to image-quality you can use to trade off between speed and quality with the highest ULTRA_QUALITY mode providing a scaled result that looks better than GIMP’s Lancoz3 implementation.

There’s ImageJ, which boasts to be the

world’s fastest pure Java image
processing program

It can be used as a library in another application. It’s architecture is not brilliant, but it does basic image processing tasks.

Another good alternative: Marvin

I’m not a Java guy, but OpenCV is great for my needs. Not sure if it fits yours. Here’s a Java port, I think:

Processing is new but very, very good.

Try to use Catalano Framework.


  • Architecture like AForge.NET/Accord.NET.
  • Run in the both environments with the same code, desktop and Android.
  • Contains several filters in parallel.
  • Development is on full steam.

The Catalano Framework is a framework for scientific computing for Java and Android. The project started as an initial port of the many features of the AForge.NET and Accord.NET frameworks for .NET, but is steadily growing with more advanced features which are now being shared between those projects.


FastBitmap fb = new FastBitmap(bitmap);

Grayscale g = new Grayscale();

Threshold t = new Threshold(120);

bitmap = fb.toBitmap();

//Show the result

imo the best approach is using GraphicsMagick Image Processing System with im4java as a comand-line interface for Java.

There are a lot of advantages of GraphicsMagick, but one for all:

  • GM is used to process billions of
    files at the world’s largest photo
    sites (e.g. Flickr and Etsy).

http://im4java.sourceforge.net/ – if you’re running linux forking a new process isn’t expensive.

For commercial tools, you might want to try Snowbound.


My experience with them is somewhat dated, but I found their Java Imaging API to be a lot easier to use than JAI and a lot faster.

Their customer support and code samples were very good too.

RoboRealm vision software list mentions JHLabs and NeatVision among lots of other non-Java based libraries.

Leave a Reply

Your email address will not be published. Required fields are marked *