Apache Commons logo Commons Imaging™ logo

Why use Commons Imaging?

Why another image library? There are so many already.

Apache Commons Imaging is written in 100% pure Java. It will run on any JVM, and any platform, without modification.

There are no dependencies. Commons Imaging only requires Java 1.8 or later.

It is designed to be very easy to use. It has a simple, clean interface. Most operations are a single Imaging method call. See the Sample Usage section.

Commons Imaging aims to be transparent. There are no hidden buffers to dispose, no native memory to free, no background threads.

It reads and writes a wide variety of image formats, and supports some variations and encodings missed by all or most other libraries. See the Format Support list.

Commons Imaging does more than read and write images. Reading image info (image size, colorspace, bit depth, etc.) and metadata is easy, and does not require reading the image pixels. It presents image info and metadata in a format-neutral manner. It also gives easy, structured access to format-specific info.

It can read from and write to files, byte arrays, or any InputStream/OutputStream. Reading InputStreams only reads data it needs, and caches what has been read, so it's efficient on I/O, and fast on slow storage and networked files.

It supports reading and writing a variety of metadata in a structured way, including EXIF metadata.

Most other libraries offer little or incomplete support for ICC Profiles. Commons Imaging can extract and (simply) parse embedded ICC Profiles. Moreover, it applies the ICC profile by default, converting read images to sRGB. This means images are color-corrected by default. see: https://en.wikipedia.org/wiki/International_Color_Consortium, https://en.wikipedia.org/wiki/sRGB

Was written with an eye to correctness and code clarity, but also good performance. Hopefully it is easy to use, easy to extend and can be used to explore images + image formats, rather than just read images for display.

It is Free Software/Open Source. It is available under the Apache Software License.

Commons Imaging also includes a number of useful functions such as guess an image's format by examining its "magic numbers" (header info).

The ColorConversions class offers methods to convert between the following color spaces: CIE-L*CH°, CIE-L*ab, CIE-L*uv, CMY, CMYK, HSL, HSV, Hunter-Lab, RGB, XYZ and Yxy (algorithms courtesy of EasyRGB's). see: https://www.easyrgb.com/