On the move... almost done!

We have almost completed the migration of this website. Now most contents are up-to-date and references to the old website have been dropped. We still have to roll out the graphic layout and some minor details. Thanks for your patience.

Overview

jrawio is a Service Provider Implementation for the Java™ Image I/O API. It provides the ability to read images coded in a digital "camera raw" format (such as NEF for Nikon or CR2 for Canon). jrawio is implemented in 100% pure Java™ and does not use any native code; it is fully supported and tested with Java 5 and Java 6.

jrawio is composed of two modules: the codec, which contains the codecs for reading the raster bits and the metadata, and the processor (a.k.a. “reajent”) that provides postprocessing. The latter is important for the quality of the results, that at the moment are just a “best effort” - usually good, but troubled with some cameras. The future version 3.0 will provide quality comparable with other existing products. Both the codec and the processor are contained in a single .jar file, but the processor can be optionally disabled to deliver the raw bits, in case you want to process them entirely on your own. Again, version 3.0 will make it possible to fine-tune the processing step, keeping some defaults and changing other steps.

Since jrawio complies with the standard Image I/O API, it doesn't provide a specific API on its own. After it has been installed, supported camera raw files can be read into BufferedImages as usual. The following example shows how to convert a Nikon NEF image into a JPEG:

                        File file = new File("DSC1234.NEF");
                        BufferedImage image = ImageIO.read(file);
                        ImageIO.write(image, "jpg", new File("DSC1234.jpg"));
                        

It is also possible to read the thumbnails (and eventually full size previews, when available) usually embedded in camera raw files. It is also possible to read metadata using the same API:

                        File file = new File("DSC1234.NEF");
                        ImageReader reader = ImageIO.getImageReaders(file).next();
                        reader.setInput(ImageIO.createImageInputStream(file));
                        IIOMetadata metadata = reader.getImageMetadata(0);
                        

Metadata can be read as a DOM / XML document, as per Image I/O standards:

                        File file = new File("DSC1234.NEF");
                        ImageReader reader = ImageIO.getImageReaders(file).next();
                        reader.setInput(ImageIO.createImageInputStream(file));
                        IIOMetadata metadata = reader.getImageMetadata(0);
                        Node node = metadata.getAsTree(metadata.getNativeMetadataFormatName());
                        

Alternatively you can cast to a specific class for each format:

                        File file = new File("DSC1234.NEF");
                        ImageReader reader = ImageIO.getImageReaders(file).next();
                        reader.setInput(ImageIO.createImageInputStream(file));
                        IIOMetadata metadata = reader.getImageMetadata(0);
                        NEFMetadata nefMetadata = (NEFMetadata)metadata;
                        

and then read single items with specific getters method. jrawio provides full access to any known item contained in "camera raw" files, including maker notes. Please be aware that the use of casting for reading metadata is supported (in the sense that results are guaranteed), but it's not a stable API (in the sense that it can change from version to version without advice). At the moment, we advise manipulating metadata by means of DOM / XML, as specified by the Image I/O API.

Version 1.6.1 supports 62 camera models (others should work, but are untested); the full list of supported camera and models is available at this page. You can check the change log and the road map of the project as well.

jrawio is an opensource product distributed under the Apache license.