Home | Monitor Tab | Preferences Tab | Profile Checker | Profile Identification | Camera/Scanner Profile Parameters | Display Profile Parmameters | Monitor Values Dialog | Set Gamma Dialog | Install Reference File Dialog | UFRAW Tutorial

LProf Main Help Window

LProf is an open source application that creates ICC profile for cameras, scanners and monitors.

Building a scanner or camera profile

Camera and scanner profiles are built by using a thing known as an "IT8 target". IT8 targets are just a photo with a set of color patches. There are known colorimetric measurements for each of these patches. There is also a standard way to specify these measurements, the IT8/CGATS file format.  Each  IT8 target comes with a IT8/CGATS file that contains the colormetric measurements for that target.

IT8/CGATS is a way to encode data that is both, human and machine readable. You can open any IT8/CGATS reference file with a text editor. You can even modify the contents. Since it is a standard, most color management systems will accept it including LProf.   A IT8/CGATS reference file contains measurements for a set of color patches. The measurement of each patch can be the device colorant values (the RGB or CMYK values in the 0..255 range) or the tristimulous values (XYZ or Lab) and some statistical data.

A IT8/CGATS reference file looks like this:

-----------------------------------------------------------

IT8.7/2 ORIGINATOR "Wolf Faust"

DESCRIPTOR "L* a* b* Batch average data (light D50, viewing angle 2)"

MANUFACTURER "Wolf Faust - http://www.coloraid.de"

CREATED "January 07, 2002" PROD_DATE "2001:12"

SERIAL "DIN A4 R012020"

MATERIAL "Kodak Professional Digital 3 - Non-Glossy"

NUMBER_OF_FIELDS 9

BEGIN_DATA_FORMAT

SAMPLE_ID XYZ_X XYZ_Y XYZ_Z LAB_L LAB_A LAB_B LAB_C LAB_H

END_DATA_FORMAT

NUMBER_OF_SETS 288

BEGIN_DATA

A1 3.25 2.71 1.94 18.86 11.18 2.87 11.55 14.41

A2 4.07 2.73 1.60 18.91 23.59 6.54 24.49 15.48

A3 5.79 3.42 1.75 21.67 33.38 9.60 34.73 16.05

A4 4.28 2.66 1.46 18.62 27.73 7.59 28.75 15.32

A5 11.97 10.30 7.42 38.38 15.04 4.16 15.61 15.47

.... etc ...

------------------------------------------------------------

The target manufacturer provides a IT8/CGATS file containing these measurements for the target. So, the target along with the targets IT8/CGATS reference file is gives us a set of KNOWN (calibrated) colors. We must then, tell the profiler which RGB values our scanner or camera returns for each of these patches.

LProf can grab the RGB values of each color patch on an IT8.7 target image. In order to generate a profile, we need the RGB and Lab values for each patch. Let's outline the scanner/camera profiling procedure.  First we will detail how this is done with a scanner and then we will detail what is different when profiling a camera.


Step 1: Adjust scanner controls.

First you should be aware that getting a good capture of the IT8.7 image is 80% to 90% of getting a good profile.  This is extremely important and this is where most problems with getting good profiles occur.

Bit depth:  You will need 24 bits (8 bits per color) per pixel at the very least but using 48 bit (16 bits per color channel) images is best.   LProf will support all RGB color depths from 8 bit integer/channel to 32 bit integer/channel for integer RGB images and 32 and 64 bit float per channel images.

Gamma: On most scanners you can select the gamma to be used for scanning the image.  In general you should use a gamma between 2.2 and 3.0. A Gamma 2.2 has the additional benefit of being close to the sRGB gamma, and this means the uncorrected Image will "look nice" on an "average" monitor. It is also near to perceptual gamma. Gamma 2.4 has the additional benefit of being closest to perceptual space, and this is a very good reason to use this value. Less that 2.2 (and of course the infamous 1.0) can generate a significant loss of detail in shadows while only to giving a slight improvement of highlight detail. Don't use this unless your are using 16 bits per channel or more, and even then, don't do it unless you know what are you doing! Gammas around 2.4 are best for flat bed scanners and film scanners with limited dynamic range.  With high dynamic range film scanners values closer to 3.0 may be best.  Don Hutchson of Hutch Color, for example, recommends a gamma of 2.8 for high dynamic range scanners.  But for flat bed scanners more than 2.4 (up to 3.0) looses some highlight detail with no gains in shadow detail.

Turn off all color management, color enhancing and tweaking in scanner driver. Set brightness, contrast and hue (if available) to default values.  Make sure that all controls are locked down and that the scanner software is not doing any automatic adjustments. These setting are supposed be your working scanning mode, so set all of them to reasonable defaults.

In addition make sure that none of the highlights on the target scan are blown out (on an 8 bit/channel scan no pixel RGB values should be equal to 255 and max RGB values as low as 225 are OK - vales around 235 to 240 are best).  This is critical as many scanners produce blown out (clipped) highlights with the scanners default settings.  Using a target image with clipped highlights will result in an invalid profile.  This is a very common error so spend some time making sure that you prevent this from happening to you IT8.7 images.

It is also important to prevent the image from being "normalized" by the scanner software.  Images that have been normalized will have the darkest pixel in the image have an RGB value of 0, 0, 0 and the brightest pixel will have an RGB value (for an 8 bits per channel images) of 255, 255, 255.  This gives the profiling software incorrect information about the true gamut/dynamic range of the device being profiled and profiles created with IT8.7 images that have been normalized by the scanner software will not be valid.  This is also a common mistake.

IMPORTANT: The profile will only be valid with the settings used to capture the IT8.7 target!

Step 2: Scan the IT8 target.

Store the IT8.7 image using one of the supported formats listed below depending on the formats supported by your platform and/or scanning software. LProf supports the following formats for IT8.7 images:

With 8, 16 or 32 bit integers or 32 or 64 bit floating point values per color channel if these higher bit depths are support by the image file format.

DON'T use JPEG! It  is unsuitable for this purpose because of the loss of information that results when the data is compressed. You could use JPEG on final images, but not in the profiling process.

Step 3: Extract the RGB values for each patch.

Without help, this could be a huge task. There are over 250 patches in a typical IT8.7 target (some have as many as 288) and taking each sample by hand would be tedious at best. With the help of LProf this is an easy task. Before we can proceed the reference file for the target must be installed so that LProf can find it.  Please see Install Reference File Dialog for details.  Start LProf and on the Camera/Scanner Profiler tab press the "Load Image" button. Select the image of target you scanned in step 2. 

I will use the scandmo.png image located in the <prefix>"/share/lprof/data/pics" directory as a sample. Where <prefix> is the installation location of LProf.  If you are running LProf from the build directory these files will be located in the data/pics directory of the source code tree.  This is a Kodak film target, scanned with a scanner that adds a large magenta cast. Don't worry, the profile will turn this one into a nice looking image and the magenta cast will help demonstrate how effective profiles generated with LProf are. The reference file for this IT8.7 target (e3199608.TXT) is also located in the same directory as the above image.  Since this is a Kodak target in the Install Reference File Dialog select the "IT8.7 19+3 (Kodak) column picker" template when installing the reference file.   To "measure" the RGB values of the target image you use the mouse to place the pick template over the patches. You can do this by clicking on each corner of the of the target image.   As each corner is selected with the mouse you will see a mark placed on the corner.  If you do not see this mark then either you have not correctly installed the reference file or you have not selected the correct reference file.

Image for IT8.7 target corner

When all four corners are marked the picker template will appear superimposed on the target image.  This will look something like this:

Image with template hot zone.

Assure that all green rectangles are inside the patches. Failure to do so will result in a wrong profile! You can adjust the locations of the corner marks to fine tune the location of the picker template.  On some images you might need to make some fairly large adjustments in the locations of the corner marks to get the template to line up.  You can also adjust the relative size of "hot areas" by setting the % in "safe frame" on "Preferences" tab. A smaller "safe frame" value results in a larger "hot" zone.  Normally there is no need to touch anything other than perhaps making adjustments to the placement of the corner marks. Once you were happy with the location of the patch grabber "hot" zones you are done with the "measurement" process and measurement file has been created and save to a hidden location by LProf. Now we can the data in the measurement file to create a profile.

 Step 4: Create the Profile:

From this point on it is quite easy.  First specify the profile filename. Press the "..." button placed on the right of "output profile file", to select the location where the profile will be saved.  On Linux/Unix systems this will default to $HOME/.color/icc.  On Windows systems this will default to the Windows profile directory (on most systems c:\WINDOWS\SYSTEM32\spool\drivers\color).  But you can override this. The file name for the new profile could be something like "scandmo.icm". You can now fill in some information to help locate the profile latter. Press the "Profile Identification" button to being up the Profile Identification Dialog, and fill in the fields.  It is important to include unique information in the "Description" field of this dialog since this information is used by many applications, including LProf, to list profiles for users.  There is also a dialog for setting the Profiling Parameters  that is used to alter the way the profile is created.  For right now just use the default settings.  You are now ready to generate the profile. Press the "Create Profile" button to launch the profile creation process. After a few seconds, you will have a profile for your scanner. 


You can inspect the profile in some detail by pressing the Profile Checker button.  If you do you will see the the demo profile has the an average dE (delta E - amount of error) that is about 1.03 and a peak dE of about 4.0, which is very reasonable.  Now, we can reduce the error level, but it will take a little more time to generate the profile. To do this press the "Edit Profile Parameters" button, and select
"33 - huge" from the  "Resolution (CLUT points)" radio button group.  Also in the Profile verbosity group select the "Verbose, store anything" radio button.   Press the "OK" button to close the "Camera/Scanner Profile Parameters" dialog and save these settings.  Next select the "Create Profile" button. Now the profile generation process will take slightly longer, but the obtained profile is improved with an average dE is about 0.8 and the peak value is about 3.6.  


Again you can use the  "Profile Checker" to inspect your profile.  In the Profile Checker have a look at the Shaper TRC curve in the curves tab.  Notice that the green curve is significantly different from the red and blue curves.  Since green is the complement of magenta this is exactly what you would expect for a device that was producing images with a magenta cast. 


Step 5: Proofing the Profile.


Let's check how this profile affects the original Image. In the "Preferences" tab set the  "input profile" to the newly created scanner profile, and "monitor profile" should be set to either a custom profile that was created using the monitor profiler (see next section) or a generic profile such as sRGB. Use the "Proof" button to turn on proofing using these profiles to see the results.  The "Proof" button is a toggle therefore pressing it a second time will revert the image and remove the changes made when the profiles were applied.  In the example IT8.7 scan the girl's Image is dark, this is normal. However, the rest of patches are hugely modified, the gray scale should appear smooth and without any cast, as well as the overall magenta tint should disappear.

Profiling Cameras


First all of the warnings that were spelled out in the scanner sections of this page about clipped or blown out highlights, blocked up shadows and normalized images apply to cameras as well.  So please read the "Adjusting scanner controls"  section again. 

It may be difficult or impossible to avoid these problems on many cameras because of the number of automatic features that modern cameras have and the fact that on many consumer level cameras it is not possible to take total manual control of the camera (this is normally not a problem with DSLR type cameras).  If that is the case then you may find it difficult or perhaps impossible to get good profiles for the camera.

Special Considerations for Wide Gamut Devices Such as Cameras


Some devices such as cameras and high end film scanners can have a very wide gamut and therefore it is harder to get good profiles for these devices.  This is particularly true for digital cameras with larger sensor sites (DSLRs) that produce raw files since the raw software can pull out much more information from the sensor data then is typical for in camera processing. 

The basic problem is that the gamut of the device is significantly wider than the gamut of the color patches in the IT8.7 target.  Because of this always setup your device such that you use its full dynamic range even if that is significantly wider than the gamut of your IT8.7 target (also see the section on normalization in the "Adjusting scanner controls" above).  When profiling a device using an IT8.7 target (or any other target for that matter) the gamut of the device profile is NOT limited by the target gamut unless you limit the range of values in the target image to less than the full dynamic range of the device.   What is limited by the target gamut are the parts of the device gamut that are well defined by known data points.   The rest of the gamut is extrapolated based on the known data points and may actually be larger than what the camera or scanner is capable of supporting since the extrapolated curves likely go down below the noise floor of the device (at least for cameras).   In fact LProf and all other profilers have large amounts of very complex code for doing this extrapolation and many commercial profiler vendors consider this code to be highly secret super duper magic stuff.

Copyright © 1998-2007 LProf. All Rights Reserved.


Copyright © 2006 LProf Trademarks
LProf 1.11.5