views:

1077

answers:

4

I'm looking for a high-level java graphic library for creating artistic text, watermarks, resize, crop, image identification and manipulation. ImageMagic is a good example of such library, but its java ports are somewhat problematic (they either run imagemagic through JNI or via commandline and are hellish to deploy to servers). Ideally I'd like to have similar functionality to ImageMagic, but pure Java and open-source, free to use. Has anyone seen something like that?

This is for a server-side component. A service that manipulates images of various web formats (png, jpg, gif etc).

Java has its own libraries, of course (Graphics2D) but I'm looking for something of higher level.

Here are several use cases:

  • Resize and crop images. If it has "smart resize" or "smart crop" that'll be cool, for example seam carving resize, or cropping by points of interest in the photo
  • Drawing artistic text on images. Using fonts, colors, text effects (3d text, charcoal and other effects)
  • Embedding watermarks.
  • Layering images, using images as background, masking with images etc.
  • Image identification such as - number of colors, stdev etc.

As mentioned, Java in its Graphics2D supports all of the above but is too low level so I'm looking for something that's nicer to work with.

Thanks!

A: 
Pierre
I'm actually looking for a bitmap manipulation package, not a vector one, so both SVG and EMF don't seem like a good fit :(
Ran
+1  A: 

Java Advanced Imaging ( JAI ) sounds like what you want. From the website:

The Java Advanced Imaging API provides a set of object-oriented interfaces that support a simple, high-level programming model which lets you manipulate images easily.

I found it relatively simple to work with. And the performance was better than spinning off ImageMagic processes.

leonm
From my experience with it (for Computer Vision and Graphics) it does quite awesome.
monksy
A: 

Use ImageJ. In addition to being a neat program, it can be used as a library.

A: 

Raw Java2D makes it quite easy to do resizing and cropping (just make sure that you reduce in powers of 2, the backend doesn't handle this automatically). I only found JAI useful for my usage to do color quantization... the rest of the pipeline seemed unnecessary for basic functions.

jdewald