Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java Graphics library

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!

like image 784
Ran Avatar asked Sep 26 '09 07:09

Ran


1 Answers

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.

like image 73
leonm Avatar answered Nov 15 '22 21:11

leonm