Color optimization with gray/color scales

Using the below ideas for optimization it is possible to do color optimization of pictures that incorporated a color/gray scale in general.
In most instances thought the IFRAO standard scale is being used as an example. The purpose of the IFRAO standard scale is multi-functional:

The first three aims are of course well met by the IFRAO standard scale.
Because I personally find the last item the most important/interesting for the IFRAO standard scale, I wanted to study that by looking at the following points, so that optimization/calibration can become a scalable possibility (say if one wants to do 100's of pictures) for researchers:

These ideas were presented at RASI 2004 in Agra India on November 30th, 2004 (11:30-12:00).
Furthermore pictures with color scale have been tested free for people of the ROCK-ART at ASU.EDU community.

These three items will be looked at in the following sections (remember most of the below text is independent of the IFRAO standard scale, but for any gray/color scale in a picture):

sRGB/AdobeRGB/Lab reference colors

IFRAO standard scale

Reference colors
Don't use a printed version of this picture as the scale on the rock art!
Only use the official IFRAO standard scale, because that one is printed under controlled conditions.

May 1994
May 1994
  Nov. 2001
Black (25,25,25) (47,46,47)
Blue (50,0,90) (65,62,116)
Dark gray (44,44,44) (62,65,61)
Green (0,134,73) (-23,144,75)
Gray (124,124,124) (116,114,114)
(115,114,113) (124,122,121)
Red (214,0,39) (207,65,60)
(194,67,53) (169,68,56)
White (255,255,255) (238,233,232)
Yellow (255,215,0) (245,211,-20)

Macbeth ColorChecker

The web site of Lindbloom gives a good overview of all the RGB color spaces and the corresponding RGB reference values for the Macbeth ColorChecker card. The sRGB values can be found here , AdobeRGB (1998) values are here and the Lab values can be calculated here (remember to have the correct Ref. Illuminant [e.g. D65 for default sRGB]).

My methodology

In my method the least square error is calculated between the reference xRGB values of the colored patches of the gray/color standard scale and the measured color patches in the picture.
The method is described in the following bullets (see comparison with others):
For definitions see the definition section (the definitions are chosen in such a way that they can be calculated by programs like Paint Shop Pro or Photoshop). In this section I use the IFRAO standard scale and sRGB color space (because sRGB matches computer screen and thus web page viewing) as an example.

Optimization method


The following software is needed:

Optimization using Jasc Paint Shop Pro 8 or 9

Some functions (see also the definitions):
The methodology is as follows:
  1. get the picture (below one is a picture made with digital camera) with gray/color scale into your drawing program:
    Initial standard scale
  2. Determine for each of the color patches the average RGB values (using three times the PSP Dropper Tool (which in itself averages upto 11*11 pixels) or Photoshop Eyedropper Tool (which in itself averages upto 5*5 pixels), and calculate the overall average using the Input worksheet). One can also use the averaging function of areas in the programs (Photoshop: Filter -> Blur -> Average or PSP: Adjust -> Blur -> Average...).
    Take these areas of the scale that have no glare.
  3. Input these average values into the coloropt20xrgbextern.xls excel spreadsheet (RGBmatrix Opt worksheet: area C6:J8 or when calculations done in Input worksheet; copy Sample database worksheet A2:I4 to RGBmatrix Opt C6:K8 with Paste Special... -> Values)
  4. It is possible to toggle each color patch (area C10:J10); to define if a color patch will (=1) or will not (=0) take part in the optimization.
  5. Start the solver by: Tools -> Solver... -> Solve ([Ctrl-r] and OK])
  6. The above determines the optimum Gammapsp and Channel mixerpsp.
  7. Have Paint Shop Pro in 24-bit color space (Image -> Increase Color Depth -> 16 Million Colors (24 bit) Ctrl+Shift+0])
  8. Use the value in C38:C40 for all channels in Gammapsp (Adjust -> Brightness and Contrast -> Gamma Correction... [Shift+G])
  9. Fill in the RGB values from G38:I40 in the Channel mixerpsp (Adjust -> Color Balance -> Channel mixer...)
  10. Use the value 2.2 for all channels the Gammaps (Adjust -> Brightness and Contrast -> Gamma Correction... [Shift+G])
  11. A script is available (use right click: Save [Link] Target As...)
  12. This gives the optimized picture:
    Optimized colorcard

    Which one can compare with this picture:
    Reference colors
  13. The whole above process can be done in some 10 minutes per picture.

Optimization using Adobe PhotoshopCS

Some functions (see also the definitions):
The methodology is as follows:
  1. Do the same as the above steps 1 to 5
  2. The above determines the optimum Curveps and Channel mixerps.
  3. Have Photoshop in sRGB mode (Edit -> Color Settings [Shift+Ctrl+K]-> sRGB IEC)
  4. Activate 16 bits/channel in Photoshop (Image -> Mode -> 16 Bits/Channel)
  5. Fill in the values from D38:E46 in the Curveps (Image -> Adjustments -> Curves... [Ctrl+M])
  6. Fill in the RGB values from G38:I40 in the Channel mixerps (Image -> Adjustments -> Channel mixer...)
  7. Fill in the values from J38:K40 in the Curveps (Image -> Adjustments -> Curves... [Ctrl+M]) for doing a Gamma=2.2
  8. No scripting is yet made by the author for Photoshop.

Definitions of functions used in optimization method


The function is: codenewg=255*(codeold/255)(1/Gamma)
The Gamma function in reality is not always a pure power function (it sometimes also has a linear effect, like in sRGB). For the optimization this has been neglected, because some drawing programs (like Paint Shop Pro 8/9) don't support other Gamma functions (e.g. as a user definable option) then the pure power function. PhotoshopCS uses something different than a pure power function, but they don't make it public.


Things to watch for when making/optimizing a picture

When making/optimizing a picture, the following diagnostical aspects need to be kept in mind:

Software improvements

The following software improvements have been communicated with companies (within each tool, they are ordered in importance):

Comparing different methods

A few general points are important for a comparison:
The following methods were utilized during this comparison (pricing given on Aug. 4st, 2005 from web sites of the downloadable products):
With these methods four cases were done:
  1. Case 1
    Where the average DeltaE (average color error) is calculated referring to the IFRAO color scale in the picture for four different light conditions: sun, shade, fluorescence and copystand light
  2. Case 2
    Where the average DeltaE (average color error)  is calculated referring to the Macbeth color scale in the picture for copystand and fluorescence light.
  3. Case 3
    Here we take only one row or some specific colors (like equivalent with IFRAO colors and an softer alternative colors) from the Macbeth ColorChecker scale to optimize (so not all). The average DeltaE is calculated referring to the remaining Macbeth color patches in the picture.
  4. Case 4
    Here we change the number of color patches that take part in the optimization.

Case 1

In the first case the CIE Lab/D65 average DeltaE (CIE 1994) is referring to the IFRAO color patches.
The results of the methods that were not optimized against the IFRAO standard card (to minimize dependancy/correlation) are:
Comparing different optimization methods

Case 2

In case 2 we use the same methods, but now the Lab/D65 average DeltaE (CIE 1994) is referring to the Macbeth color patches.
The results of the methods that were not optimized against the Macbeth Colorchecker card (to minimize dependancy/correlation) are:
Comparing the Macbeth colors

My own method (VR) does not have the best numerical results, but using the naked eye it does not look that bad;-)
Orginals on left and optimizations on right
(fluorescence, cloudy, shade, sun, copystand light)

Case 3

Here the Lab/D65 average DeltaE (CIE 1994) is referred to the Macbeth color patches, while we use ICE Color for optimizing:
  • each row (6 colors) of the Macbeth color scale to optimize (1st row: top row of colors, 4th row: bottom [neutral] colors) (xxx row/MB)
  • equivalent colors as the IFRAO card on the Macbeth card (8 colors: blue, green, red, yellow, white, neutral 5, neutral 3.5, black) (Equiv. color/MB)
  • alternative softer colors than the IFRAO card on the Macbeth card (8 colors: light skin, blue sky, foliage, orange yellow, neutral 8, neutral 5, neutral 3.5, black) (Alt. color/MB)
This gives the following result when only taking those MacBeth ColorChecker patches that are not used for determining the optimum (to minimize dependancy/correlation):
Comparing rows/cells of Macbeth card
Only done for copystand light, because that light seemed to give in most
methods comparable results as the average results in case 1

Case 4

Here the Lab/D65 average DeltaE (CIE 1994) is referred to the Macbeth plus IFRAO color patches which did not take part in the optimization using ICE Color. The number of Macbeth ColorChecker patches in the optimization is varied between 0 and 24. The following results were gotten:
Changing the number of color patches

Comparing the cases

  • It looks that for case 1 and 2 the different lighting conditions behave comparable (at least for copystand and fluorescence).
  • The ICE Color, VR and inCamera methodologies perform comparable in case 1 and 2.
    ICE Color though is not always consistent (I am discussing this with the authors) and inCamera is not working easily for the IFRAO standard scale (see next bullet). At this moment I prefer the VR method.
  • It would be interesting to see the behavior of inCamera when optimizing it against the IFRAO standard scale, but then a business case needs to be made towards PictoColor Cooperation.
  • The method using the black/gray/white dropper tool (BGW) is not really consist and has a large variance in error.
  • Interesting to see that the Black, Neutral 5, White optimization in case 4 (using ICE Color) looks better than in case 1 or 2 (using the BGW method), this could be due to different methologies.
  • From case 4, it looks that the more color patches one uses, the smaller the average DeltaE and the smaller the variation in error is.
  • The limited amount of color patches in the IFRAO standard scale will limit the color optimization/calibration that can be reached.
  • There is not much difference in results between real colors (case 3, 1or2or3rd row/MB) and grays (case 3, 4th row/MB), so I assume that grays are just as important as normal colors for the optimization.
  • Comparing average errors (DeltaE) in case 3 of the Equivalent IFRAO colors and the Alternative softer colors, it looks like that the hard colors provide a comparable error as the softer colors (the difference between the two is hardly significant).

Free optimization service

If you have a rock art picture with a color scale in it (Macbeth or IFRAO) you can send it to me (remove underscore in presented e-mail address), I will try to optimize/reconstruct the colors for you. But you have to do something in return;-), I will resent three low quality pictures first:
  1. one using the program ICE Color (using semi linear space)
  2. one using the program ICE Color (in xRGB space)
  3. one using my own methodology together with PSP.
After you tell me which picture has the colors that are the closest to the original, I will send you that specific picture with approximately the same file size as the original. After doing that I will delete all the related picture files from my systems (so I will not use your files except for the above purpose).

Just to be sure, I can't give any guarantees about the quality and also my initiative is not linked to any organization; so it is just a private initiative! Due to that, I will limit my services to my own discretion.

So if you want to utilize this opportunity; send your file(s) to me (remove underscore in presented e-mail address) (please don't send files bigger than 2 MBytes, if not communicated with me first) and tell me if you want to have it optimized towards AdobeRGB or sRGB.

Space for improvement of IFRAO standard scale

The following improvements could be made to the IFRAO standard scale. The IFRAO is of course responsible for the implementation of the IFRAO standard scale, so I leave it to their judgment if they want to implement the suggested improvements (I have no relations with them, I am just a user of the card).

But first ideas without changing the character of the existing IFRAO standard scale:
Glare is evident (compare left and right picture) on this standard scale;
no sun, just a cloudy/rainy day. One can get rid of the glare
by having the camera in a different standpoint
(left: camera at 45 degrees, right: camera at 0 degrees).
PIETJE color card behaves better with regard to recording angle.
Somewhat bigger changes to the IFRAO standard scale could be made to optimize the calibration/optimization results:

Future steps

If people (like students) want to provide help, let me know. I am looking at the following extensions to my above study: Keep in mind that at least one proper working version of the methodology has to be in the public domain (does not have to be free). If something emerges out of such a future study, we need to discuss and fix things around IPR (Intellectual Property Rights) if the above ideas are commercialized.


I would like to thank the following people for their help and constructive feedback: Tim Autiokari, Robert Bednarik, ICE Graphics team, Chris Cox, Len Hewitt, Gernot Hoffmann, Wayne Huelskoetter, Bruce Lindbloom, Robert Mark, Alfonso Montejo, Joseph Wilhelm and all other unmentioned people. Any remaining errors in methodology or results are my responsibility of course!!! If you want to provide constructive feedback, let me know.

Disclaimer and Copyright

Major content related changes:  May 28, 2004