ICC profiles are commonly used to define an image's colour space. The JP2 specification (15444-1annexi.pdf) defines a method for embedding profiles in JP2, which is called the Restricted ICC method. Using a subset of the full ICC specification, the following restrictions apply:
- For RGB colour spaces, N-component LUT-based profiles are not allowed (only three-component matrix-based profiles).
- Only input device profiles are allowed (for both monochrome and RGB spaces)
The most commonly used working colour spaces such as Adobe RGB and eciRGB belong to the class of display device profiles. As a result, these profiles are not permitted in JP2, even though they are technically identical to input device profiles. This restriction is dealt with differently by different encoders/decoders. In some cases this results in files that don't adhere to the JP2 specification. In particular, some encoders will produce JPX files that use an embedding method (Any ICC method) that is not allowed in JP2. The standards committee is currently addressing this issue through an amendement to the existing standard (see below).
- Strict adherence to the standard will severely limit colour management in JP2 (which may have an impact on overall image quality).
- The various solutions for getting around the input profile limitation sometimes result in files that do not conform to the standard. Consequently such images may not display as originally intended, or colour information may get lost in future migrations.
Files that contain features that are not permitted in JP2 will not pass validation by Jpylyzer.
|Tool||Affected if expression returns True|
|Jpylyzer||"/jpylyzer/isValidJP2 = 'False'"|
Jpylyzer performs the following ICC-related tests:
|methIsValid||: colour specification is valid|
|iccPermittedProfileClass||: profile class is either input device or display device|
|iccNoLUTBasedProfile||: profile is not of the N-component LUT-based type|
|iccSizeIsValid||: actual size of embedded ICC profile equals value of profileSize field in ICC header|
Note that Jpylyzer does not validate the actual ICC profile data (i.e. it does not include an ICC profile validator)! It only checks whether a specific ICC profile's feature set meets the criteria defined by the Restricted ICC method.
A JP2 will not pass validation if any of the above tests fail. The subsections below, which describe how to check the most important ICC-related properties, are provided for information only.
|Tool||Location in output|
|Enumerated||: Named colour space (no ICC profile)|
|Restricted ICC||: Restricted ICC method|
|Any ICC||: Any ICC method (not allowed in JP2, only in JPX; file will not pass validation!)|
|Tool||Location in output|
|Input Device Profile|
|Display Device Profile|
In case of any other values (possible in ICC, but not allowed in JP2) the file will not pass validation!
|Tool||Location in output|
|Adobe RGB (1998)|
|Gray Gamma 2.2|
The table below shows, number of widely-used encoder/decoder applications, what happens when we try to create a JP2 from a source TIFF that contains an embedded display device profile.
|Encoder||Output format||Embedding method|
|Kakadu kdu_compress (Kakadu 7.2 and more recent)||JP2||Restricted ICC|
|Kakadu kdu_compress (Kakadu versions up to 7.1)||JP2||ICC profile not embedded|
|Aware JPEG 2000 SDK||JP2||Restricted ICC|
|Luratech command line tool, version 220.127.116.11||JP2||Restricted ICC (but profile class field changed to input device)|
|Luratech command line tool, version 18.104.22.168||JPX||Any ICC|
|Adobe Photoshop CS4 with Adobe JPEG2000 plugin, "JP2 compatible" option not checked||JPX||Any ICC|
|Adobe Photoshop CS4 with Adobe JPEG2000 plugin, "JP2 compatible" option checked||JPX||Any ICC + Restricted ICC * Note|
|ImageMagick||JP2||ICC profile not embedded|
|GraphicsMagick||JP2||ICC profile not embedded|
|OpenJPEG||JP2||ICC profile not embedded|
Source: http://www.dlib.org/dlib/may11/vanderknijff/05vanderknijff.html with additional (unpublished) tests by same author.
Note: Original profile uses "Any ICC" method; modified version uses "Restricted" method, where profile class of the original profile (display device) is changed to input device, and a "modified" prefix is added to the profile description field (e.g. "Modified eciRGB v2").
- Use Jpylyzer to establish if files are valid JP2 (see above).
- If files fail the above test, mark this in their associated metadata. Document the issue and the associated risks.
- Normalisation of files that contain JPX specific embedding methods may be considered.
In May 2013 an amendment to the standard was published which allows, among other things, the use of display device profiles in JP2. See also the following blog post by Rob Buckley, and the August 2011 draft of the amendment. This amendment completely fixes the previous shortcomings of the standard.
The following 2 files were created with Adobe Photoshop CS4 + Adobe JPEG2000 plugin 2.0:
- http://www.opf-labs.org/format-corpus/jp2k-test/icc/balloon_eciRGBv2_ps_adobeplugin.jpf - ICC profile uses Any ICC method
- http://www.opf-labs.org/format-corpus/jp2k-test/icc/balloon_eciRGBv2_ps_adobeplugin_jp2compatible.jpf - two versions of ICC profile: one uses Any ICC, other Restricted ICC method
This file was created with the Aware JPEG 2000 SDK 3.19:
- http://www.opf-labs.org/format-corpus/jp2k-test/icc/balloon_eciRGBv2_aware.jp2 - ICC profile uses Restricted ICC method
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
Van der Knijff, J.M. ICC profiles and resolution in JP2: update on 2011 D-Lib paper.
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