DRAFT PROPOSAL: jrawio - ImageIO codecs for "camera raw" formats

Fabrizio Giudici fabrizio.giudici at tidalwave.it
Sun Mar 2 02:48:52 PST 2008


                               DRAFT PROPOSAL

Provision of jrawio, a set of ImageI/O codecs for "camera raw"  
formats, suitable for inclusion in OpenJDK

Fabrizio Giudici
fabrizio.giudici(at)tidalwave.it


1. Summary
----------

The Java Image I/O API (javax.imageio) is a part of the JDK focused  
on image input/output. It basically provides a plugin-based set of  
classes for reading images from and writing to a stream (both raster  
and metadata operations are supported). In the standard Java runtime  
a number of plugins for the most common formats are available (e.g.  
JPEG, PNG, BMP), others are in the optional package JAI-ImageIO (e.g.  
TIFF), other formats are available in third-parties' plugins.

With the advent of professional digital camera bodies, manufacturers  
such as Nikon, Canon, Minolta Pentax and others have introduced a  
number of proprietary formats, commonly named "camera raw" formats  
(NEF, CRW, CR2, MRW, etc...) [1]. In this scenario, also Adobe  
developed its own format, Adobe Digital Negative (DNG). "Camera raw"  
formats share the peculiarity of not containing an image ready-to-be- 
shown, rather a "dump" of the raw data from the digital sensor with a  
set of annotations about the camera settings at the moment of the  
shoot. This makes them a sort of "digital negative", as photographers  
can manipulate ("develop") them in post-production with a much wider  
gamma of possibilities than JPEG or TIFF would offer; it also makes  
it easier "non-destructive processing" (the capability of undoing a  
developing settings without compromising the original bits).

While most of these formats are a variant of TIFF, they can't be  
properly handled by the TIFF ImageI/O plugin, because 1) it can't  
understand the extensions and 2) ImageI/O plugins expect that the  
raster data doesn't need any post-processing (other than  
decompression). Also, many "camera raw" formats use non-standard  
compression schemata.

jrawio [2,3] is an open source implementation of a set of read  
plugins for supporting these formats. It is currently composed of two  
parts:

a) jrawio itself, the javax.imageio plugin. It only delivers  
metadata, thumbnails and "raw" bits out of the stream.
b) reajent - it's a post-processor that "develops" the raw bits into  
a viewable picture. This is an optional component, as applications  
could decide to provide their own implementation of this part  
(providing special "recipes" for developing "camera raw" formats is  
typical of this context).

jrawio is an original development. At the moment of writing there are  
no other known ImageI/O-compliant plugins for "camera raw" formats.  
jrawio only uses original code (with the exception of the required  
compliance with the ImageI/O API), partially inspired by dcraw.c by  
Dave Coffin [4] as most of the "camera raw" formats are undocumented  
(DNG being a notable exception) and dcraw.c is the only available  
"documentation" for the community. An older dismissed project by the  
same author, NEFio [9], was just the initial version of jrawio with a  
different name as it only focused on the NEF format.

This project is a single-developer submission. Fabrizio Giudici is in  
charge for the rules of the Open JDK Challenge.


2. Goals and deliverables
-------------------------

The goal of this project is to provide a working ImageI/O plugin that  
can be used by professional imaging applications.


3. Previous work
----------------

Work on jrawio and reajent has already started [2,3] delivering a  
1.0.RC5 which is stable and suitable for experimental use. Since 2007  
the focus has been on the design of the new APIs and the setup of a  
public test sets, and there have been only a few unofficial releases.  
This project represents the continuation of that development.

At the moment, the metadata and raster I/O parts of jrawio support  
the following formats: CR2, CRW, DNG, MRW, NEF, PEF, SRF, but only  
for a subset of the existing camera models (each camera model is  
likely to use a variant of the main format). It is estimated that the  
current codebase contains about 80% of the needed classes for those  
formats, that should be complete at 80%. Support for other formats  
(such as Kodak DCR) should be added, but it's difficult to estimate  
the effort for them prior knowing their structure.

Unit tests exist for about 10% of the codebase, while there are  
integration tests over a set of around 1,000 image files verifying  
that jrawio correctly reads rasters, thumbnails and metadata. A  
problem exist about the test set since it's mainly composed of images  
available on the Web, but most of them cannot be redistributed. The  
"Imaging Test Set Repository" initiative [5] should give a solution  
to this problem.

The above estimates does not include the reajent component, as it  
does not form part of this proposal.

The jrawio and reajent implementations are licensed under the Apache  
Software License 2.0. We are open to change it as needed for  
compliance with the OpenJDK license.

If this proposal is selected, and proceeds to completion, the entir  
codebase will be made available under the SCA (both the parts already  
coded, and the additions made since).


4. Milestones
-------------

Development milestones shall ultimately be determined by the working  
group. However the outline plan is:

1) Provide test and appropriate bug fixes to verify the full  
compliance with the javax.imageio APIs

2) Add support for all the camera models using the currently  
supported formats

3) Provide a small extension mechanism (based on META-INF/services)  
so support for new camera models, including a variant of the file  
format, can be just dropped in, eventually at application level, as a  
classpath extension. This will be needed since new camera models  
using "camera raw" formats are released much more frequently than JDK  
updates.

4) Add support for new "camera raw" formats



5. Deliverables
---------------
The deliverables are:

1) The source code of jrawio (both the jrawio component itself and  
the reajent component)

2) Tests with 90%+ coverage.

3) Source code documentation in the form of javadoc suitable for  
inclusion in the JDK.

Any API extension for dropping in reajent replacement does not form  
part of the deliverables of this proposal (we wish to point out that  
it is our intention to make reajent part of the OpenJDK too, but it  
won't be possible to complete it by the end of the OpenJDK Innovation  
Grant programme).


6. Dependencies on Sun
----------------------

There are no known dependencies on Sun - the project just supports  
javax.imageio and will be kept up to date with the evolution of those  
APIs.


7. Developers
-------------

Fabrizio Giudici has worked with Java since 1996, from J2ME to J2EE.  
Has has developed in Open Source since 2003. He is a Member of the  
NetBeans Dream Team and developer of blueMarine [6] and Mistral [7].  
He currently works for his own company, Tidalwave s.a.s., as a Senior  
Architect, Mentor and Technical Instructor.

[1] http://en.wikipedia.org/wiki/Raw_image_format
[2] http://jrawio.dev.java.net
[3] http://jrawio.tidalwave.it
[4] http://cybercom.net/~dcoffin/dcraw/
[5] https://imaging.dev.java.net/TestSetRepository.html
[6] http://bluemarine.tidalwave.it
[7] http://mistral.tidalwave.it
[8] http://www.tidalwave.it
[9] http://sourceforge.net/projects/nefio





More information about the challenge-discuss mailing list