SampleICC and IccXML

0
474

SampleICC is a set of C++ libraries for the manipulation and operations of ICC color profiles. Although it is a more or less active project, it is not very well documented, which makes its use particularly tedious.

However, experimenting a little with SampleICC might be worthwhile to understand its possibilities.

The project’s website is located at http://sampleicc.sourceforge.net/ and we can download it from http://sourceforge.net/projects/sampleicc/. For its use, we must first create the binaries from the source code. The process is simple:

After downloading the SampleICC-1.6.4.tar.gz package and decompressing it, we enter the directory via command line and execute the usual compilation sequence:

  cd SampleICC-1.6.4
  ./configure
  make
  make install

Initially, I had no problems with the process on my Leopard. The installation creates the binaries in the /usr/local/bin/ directory, so these applications will already be available from the command line.

SampleICC is composed of a good number of tools, each more specific and less documented than the last. Some that seemed more relevant to me are:

iccProfLibTest /path/to/my/profile.icc

This tool allows evaluating whether an ICC color profile complies with the standard, seeing which tags are not allowed, and editing the profile accordingly.

The possibilities of iccProfLibTest are:

=======================================
  0. Show Menu
  1. Show Profile Header and Tag Table
  2. Show tag contents
  3. Add Tag
  4. Save Profile and Exit
  5. Validate Profile
  6. Delete Tag
  7. Save a copy of the profile.
  9. Exit
=======================================

If we have a Windows platform, there is already an application called SampleICC Profile Dump Utility that can be downloaded from http://www.color.org/wxProfileDump.zip and that will allow us to perform this type of validation visually.

Another tool is:

iccDumpProfile /path/to/my/profile.icc

Which allows us to dump the tags of our profile with a result similar to this:

  Profile:          '/Users/jpereira/Library/ColorSync/Profiles/colorcheckerFinalCut.icc'
  Profile ID:       Profile ID not calculated.
  Size:             44360(0xad48) bytes

Header
——
Attributes: Reflective | Glossy
Cmm: Argyll CMS
Creation Date: 11/24/2011 01:43:54
Creator: ‘argl’ = 6172676C
Data Color Space: RgbData
Flags EmbeddedProfileFalse | UseAnywhere
PCS Color Space: XYZData
Platform: Macintosh
Rendering Intent: Relative Colorimetric
Type: InputClass
Version: 2.20
Illuminant: X=0.9642, Y=1.0000, Z=0.8249


Profile Tags
————
Tag ID Offset Size
—- —— —— —-
profileDescriptionTag ‘desc’ 228 111
copyrightTag ‘cprt’ 340 47
mediaWhitePointTag ‘wtpt’ 388 20
mediaBlackPointTag ‘bkpt’ 408 20
AToB0Tag ‘A2B0’ 428 41818
charTargetTag ‘targ’ 42248 2111
Unknown ‘DevD’ = 44657644 ‘DevD’ 42248 2111
Unknown ‘CIED’ = 43494544 ‘CIED’ 42248 2111

Finally, another interesting application is the one that allows us to convert an image from one color space to another; the syntax is:

iccApplyProfiles src_img_path src_profile_path dest_profile_path dest_image_path {Rendering_intent}

SampleICC has many other interesting tools such as those that allow integrating a LUT within a profile: create_lut_profile, create_CLUT_profile_from_probe, create_display_profile, flatten_AToB_tag, etc., …

IccXML

iccXMLThis tool caught my attention tremendously, although I have not managed to fully exploit it. As the reader may have already deduced, IccXML allows converting an ICC profile into an XML file and what seemed most interesting, converting an XML file into an ICC profile; however, this operation on my Leopard ends with a “Segmentation fault,” which makes me think of a compatibility problem with my operating system.

Installing IccXML on Mac OS X has some particularities:

Requirements:

1º Have Pkg-config installed: port -d install
2º Have libxml-2.0 installed: port -d install libxml2

To successfully complete our make, we must generate several sampleICC files; otherwise, ./configure will not detect the sampleICC installation.

For this, we do:

  cp /usr/local/lib/pkgconfig/sampleicc.pc /usr/lib/pkgconfig/sampleicc.pc
  cp /usr/local/lib/pkgconfig/sampleicc.pc /opt/local/lib/pkgconfig/sampleicc.pc

At this point, we are ready to perform the usual compilation routine:

./configure
  make
  make install

After this process, we already have in our command line:

  icctoxml  /path/to/my/profile.icc  /path/to/my/profile.xml
  iccfromxml /path/to/my/profile.xml  /path/to/my/profile.icc