View Source

h2. Description

The format specification ([JP2^15444-1annexi.pdf]) defines two sets of header fields for storing an image's grid resolution: 'capture resolution' and 'default display resolution'. However, the description of the 'default display' fields is vague and open to multiple interpretations, whereas the definition of 'capture resolution' is partially incomplete. This has lead to the situation that the software of most vendors will only write to / read from the 'capture' fields, whereas some others (esp. _Kakadu_'s _kdu_compress_ and _kdu_expand_ version 6.4 and earlier) only consider the 'default display' fields.

The standards committee is currently addressing this issue through an amendement to the existing standard (see below).

h2. Risks

As these fields are handled differently by different encoders/decoders, this introduces the risk that future migrations may lead to loss of resolution information. In addition, hardcopy printouts may be printed at the wrong size, and some software products for optical character recognition may fail to process images because the underlying algorithms only work properly if accurate resolution information is available.

h2. Assessment

h3. Check if resolution box exists

|*Tool*|*Exists if expression returns _True_*|
|[Jpylyzer]| {{"boolean(/jpylyzer/properties/jp2HeaderBox/resolutionBox)"}}|

h3. Check if capture resolution box exists

|*Tool*|*Exists if expression returns _True_*||
|[Jpylyzer]| {{"boolean(/jpylyzer/properties/jp2HeaderBox/resolutionBox/captureResolutionBox)"}}|

h3. Check if display resolution box exists

|*Tool*|*Exists if expression returns _True_*||
|[Jpylyzer]| {{"boolean(/jpylyzer/properties/jp2HeaderBox/resolutionBox/displayResolutionBox)"}}|

h2. Resolution handling by popular JPEG 2000 implementations

The table below shows the default fields that are used by a number of widely-used encoder/decoder applications.

|*Encoder*|*Capture Resolution*|*Default Display Resolution*|
|Kakadu _kdu_compress_ (version 6 and before)|(x)|(/)|
|Kakadu _kdu_compress_ (version 7 and later)|(/)|(x)|
|Aware JPEG 2000 SDK |(/)|(x)|
|Luratech command line tool|(/)|(x)|
|Adobe Photoshop CS4 with Adobe JPEG2000 plugin|(/)|(x)|

*Source*: [] with additional (unpublished) tests by same author.

h2. Recommendations

h3. General

Formulate policy ('control policy') on storage of resolution in JP2s, taking into account existing workflows (including optical character recognition and possible future migrations). Note here that currently most encoders/decoders use the 'capture' fields.

h3. Pre-ingest

Use [Jpylyzer] to establish if files conform to 'control policy'. Reject any files that do not pass this test.

h3. Existing collections

* Use [Jpylyzer] to establish if files conform to 'control policy'.
* If files fail the above test, mark this in their associated in metadata. Document the issue and the associated risks.
* Normalisation may be considered. This could be as simple as changing the 'type' field of a 'default display' box to 'capture' (or vice versa). Nevertheless, this would require careful planning and risk assessment.

h2. Additional information

h3. Upcoming changes to the standard

An amendment to the standard (ISO/IEC 15444-1:2004/AMD6) -is in preparation- has been published which -will-, among other things, includes a more specific description of the resolution fields and their intended use. This should clear up most confusion about this in the future. See also the following [blog post by Rob Buckley|], and the [August 2011 draft of the amendment|].

h3. Kakadu

From version 7.0 onward, _Kakadu_'s _kdu_compress_ tool will use the 'capture' fields when converting a TIFF to JP2. This change brings it in line with the amendment (see above) and the existing behaviour of most other encoders (_Luratech_, _Aware_, etc.).

h2. Example files
* [] - Sample file Aware 3.19 (Capture Resolution)
* [] - Sample file Kakadu 6.1 (Default Display Resolution)
* [] - Sample file Kakadu 7.1 (Capture Resolution)
* [] - Sample file OpenJPEG 1.5 (no resolution fields at all)
* [] - Sample file GraphicsMagick 1.3 (no resolution fields at all)

h2. References

[Buckley, R. Color in JP2. Wellcome Library. April 2011 |]
[Van der Knijff, J.M. JPEG 2000 for Long-term Preservation: JP2 as a Preservation Format. D-Lib Magazine Volume 17, Number 5/6. May 2011 |]
[ISO/IEC 15444-1:2004/PDAM 6. Updated ICC profile support, bit depth and resolution clarifications. Draft, August 2011.|]
[T.800 : Updated ICC profile support, bit depth and resolution clarifications|!Amd6/en]