Monday, November 30, 2009

Backwards compatibility

Little CMS 2 is almost a full rewrite of 1.x series, so there is no guarantee of backwards compatibility. Having said this, if your application doesn’t make use of advanced features, probably all what you need to do is to change the include file from lcms.h to lcms2.h and maybe to do some minor tweaks on your code. Profile opening and transform creation functions are kept the same, but there are some changes in the flags.  Little CMS 2 does offer more ways to access profiles, so it is certainly possible your code will get simplified.  The basic parts where Little CMS 2 differs from 1.x series are:
  • ·    Transform flags
  • ·    Error handling
  • ·    Textual information retrieval
  • ·    New non-ICC intents
  • ·    Floating point modes
  • ·    Pipelines


On internal advanced functions, the underlying implementation has changed significantly. You still can do all what lcms1 did, but in some cases by using a different approach. There are no longer gamma curves or matrix-shaper functions. Even the LUT functions are gone. All that has been superseded by:
  • ·    Gamma functions -> Tone curves
  • ·    Matrix Shaper, LUT -> Pipelines
  • ·    LUT resampling -> Optimization engine
There is no one-to-one correspondence between old and new functions, but most old functionality can be implemented with new functions.

Sunday, November 29, 2009

What is new from lcms 1.x

First obvious question is “why should I upgrade to Little CMS 2.0”. Here are some clues:

Little CMS 2.0 is a full v4 CMM, which can accept v2 profiles. Little CMS 1.xx was a v2 CMM which can deal with (some) V4 profiles. The difference is important, as 2.0 handling of PCS is different, definitively better and far more accurate.
  • It does accept and understand floating point profiles (MPE) with DToBxx tags. (Yes, it works!) It has 32 bits precision. (lcms 1.xx was 16 bits)
  • It handles float and double formats directly. MPE profiles are evaluated in floating point with no precision loss.
  • It has plug-in architecture that allows you to change interpolation, add new proprietary tags, add new “smart CMM” intents, etc.
  • Is faster. In some combinations, has a x 6 throughput boost.
  • Some new algorithms, incomplete state of adaptation, Jan Morovic’s segment maxima gamut boundary descriptor, better K preservation…
  • Historic issues, like faulty icc34.h, freeing profiles after creating transform, etc. All is solved.

Saturday, November 28, 2009

Documentation strategy

Little CMS documentation is hold in three different papers. First one is the tutorial. Its goal is to introduce the engine and to guide you in its basic usage. It does not, however, give details on all available functionality. For that purpose, you can use the API reference, which gives information on all the constants, structures and functions in the engine. The third document is the plug-in documentation. It details how to extend the engine to fit your particular purposes. You need some experience in the core API to write plug-ins, therefore, the plug-in API reference is somehow more advanced that the remaining two.

Aside documentation, there are sample programs that you can explore. Those are located in the “utils” folder. Those programs are also handy in isolation. This is the list of utilities, each one is documented elsewere.

  • TiffICC
  •  JpegICC
  •  TransICC
  •  LinkICC
  •  TiffDiff
  • psicc