Skip to content

pmjdebruijn/colormatch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ColorMatch
==========
ColorMatch allows you to create an ICC standard color profile 
based on the color transform your camera firmware uses to
create JPG files. This profile can then be applied to your
RAW files using RAW editing software.

Keep in mind that ColorMatch should be considered as highly
experimental and requires meticulous application of the 
procedures below in order to be successful.

WARNING: Keep in mind that ColorMatch comes with no warranty
whatsoever, use at your own peril.


Target
======
To be able to use ColorMatch you can self print your a custom
designed target (colormatch.tif) on satin or matte photo paper.

Alternatively you can purchase a commercial IT8 chart that
includes absolute chart (batch) reference data:

 * Wolf Faust C1 DIN A4 IT8 Camera Target 
   (http://www.targets.coloraid.de/)

 * LaserSoft Imaging DC Pro Target
   (https://www.ebay.com/usr/it8-targetshop)


Software
========
To be able to use ColorMatch you need the following software:

 * bash                 (4.3)
 * argyll               (1.6.3)
 * exiv2                (0.23)


Camera Configuration
====================
Properly configuring your camera is absolutely critical for
ColorMatch to succeed, please consult your camera manual
for instructions on how the achieve the settings below:

 * Disable Fuji D-Rng
 * Disable Nikon Active D-Light
 * Disable Canon Auto Lighting Optimizer
 * Disable Canon Highlight Tone Priority
 * Disable Sony Dynamic Range Optimizer
 * Disable Olympus Shadow Adjustment Technology
 * Disable Panasonic Intelligent D-Range
 * Disable Samsung Smart Range
 * Disable Pentax D-Range
 * Disable Pentax Multi Auto White Balance
 * Disable Lens correction, if possible
 * Disable Sharpening
 * Set camera to Adobe RGB colorspace
 * Set camera to 1/3EV exposure increments
 * Set camera to base ISO (usually 100 or 200)
 * Set camera to RAW+JPG (Full Resolution, Super Fine)


Shooting The Target
===================
Shoot the target preferably in direct sunlight as close
to midday as possible. Have the target fill out most of the
frame. matrix metered camera exposure should be mostly right
(probably +1/3EV), however it's recommended to do extensive
bracketing to make sure you have a wide range of exposures
to select the right one from later on.

You may need to shoot the target at a slight angle to 
prevent glare.

It's probably best not to use exotic glass to shoot the 
target, a 50 mm prime is likely ideal, if unavailable, any
kit-lens should suffice. To prevent vignetting from affecting
the procedure, it's recommended to close down the aperture
a stops or two from its maximum value. So you'll likely end up
shooting at f/8 or so.


Selecting The Right Exposure (ColorMatch target)
================================================
Open a candidate JPG in GIMP and verify there is no dust or
glare in the image. Then open the color picker, set sample
average, use info window and get HSV values.

When you sample the white E6 patch, you should see a value
larger than 90%, and smaller than 10% for the black R1 patch.

Then proceed to measure the four grey outer corners of the
chart, the value difference between the darkest and
brightest corners should be well below 5%.

If all of the above requirements have been satisfied, crop
the chart, so only the chart remains visible, including
cropping off the text. Save the resulting image as a 8-bit
TIFF (without compression).


Selecting The Right Exposure (IT8 target)
=========================================
Open a candidate JPG in GIMP and verify there is no dust or
glare in the image. Then open the color picker, set sample 
average, use info window and get HSV values.

When you sample the white GS0 patch, you should see a value
larger than 90%, and smaller than 10% for the black GS23 patch.

Then proceed to measure the four grey outer corners of the 
chart, the value difference between the darkest and 
brightest corners should be well below 5%.

If all of the above requirements have been satisfied, crop
the chart, so only the chart remains visible, including
cropping off the text. Save the resulting image as a 8-bit
TIFF (without compression).


Selecting The Right Exposure (DC Pro target)
============================================
Open a candidate JPG in GIMP and verify there is no dust or
glare in the image. Then open the color picker, set sample
average, use info window and get HSV values.

When you sample the white J3 patch, you should see a value
larger than 90%, and smaller than 10% for the black J13 patch.

Then proceed to measure the four grey outer corners of the
chart, the value difference between the darkest and
brightest corners should be well below 5%.

If all of the above requirements have been satisfied, crop
the chart, so only the chart remains visible, including
cropping off the text. Save the resulting image as a 8-bit
TIFF (without compression).


Processing The RAW
==================
Open the respective RAW in your favorite RAW processing
software, and disable all possible processing. Set linear 
gamma (1.0) and set input and output profile to the same
profile, and rendering intent to absolute colorimetric if 
possible, effectively creating a color management 
pass-through. Then apply cropping, and lens distortion
correction if needed, be careful not to apply lens 
vignetting correction. Then save to a 16-bit TIFF
(again without compression).

Particularly for Darktable, make sure camera white balance 
is unchanged, disable basecurve, disable sharpen, set a
linear rec2020 for input and output color profile. Make 
sure not to override the output color profile while 
exporting.

Particularly for UFRaw, make sure camera white balance is 
unchanged, restore details for negative EV: clip, clip 
highlights for positive EV: digital linear, load Argyll's 
ClayRGB1998.icm both as camera and output profile, with
an absolute colorimetric rendering intent. Set output
bit depth to 16-bit. Set gamma 1,00 and linearity 0,000.
Also make sure Embed exif data in output is enabled.

Particularly for DCRaw, you can use the following command:
# dcraw -v -w -M -H 0 -o 0 -6 -W -g 1 1 -f -m 1 -T ../_MG_1234.CR2


Running ColorMatch
==================
The ColorMatch script takes up to six arguments:
 (1) the camera processed image
 (2) the linear RAW processed by your RAW converter
 (3) optionally, a style name to be included into the profile description
 (4) optionally, chart recognition file, defaults to ColorMatch.cht
 (5) optionally, chart reference file, defaults to ColorMatch.cie
 (6) optionally, camera image colorspace, attempts to autodetect

# colormatch CAMERA.TIF IMG_1234.TIF Standard
# colormatch CAMERA.TIF IMG_1234.TIF Standard it8.cht R190808.txt sRGB.icm
# colormatch CAMERA.TIF _MG_1234.TIF Standard LaserSoftDCPro.cht D120104.txt ClayRGB1998.icm

At the end of the script, you should see a plot, which should
be a fairly smooth curve, with in most cases a notch at the
lower right side.

Note that colormatch expects all ArgyllCMS utilities to be
available in your system path, if not, you will have to adapt
the script to whatever your situation is.


Using The Profile
=================
Particularly for Darktable, copy the resulting ICC color profile
into Darktable's input color profile directory, like so:
# mkdir -p ~/.config/darktable/color/in
# cp my.icc ~/.config/darktable/color/in
Then select the profile in the input color profile module, in
Darkroom mode. Make sure basecurve is disabled.

Particularly for UFRaw, copy the resulting ICC color profile
to a location that's convenient for you. Then load the ICC
file from UFRaw GUI as the camera profile, make sure gamma
is set to 1,00 and linearity is set to 0,000.

Particularly for DCRaw, you can use the following command:
# dcraw -v -w -H 0 -o 1 -p my.icc -W -g 1 1 -f -m 1 -T _MG_1234.CR2


Testing The Profile
===================
There is no definitive way to test a generated profile, it may
work marvellously on one image and fail horribly on another.

Most typical problems will likely occur in the highlights and 
shadows. So testing a profile with overexposed and underexposed
images is a good way to start.

Other good test cases are portraits, images with clouds,
high-key, low-key, etc.


Thanks
======
A lot of people on the ArgyllCMS mailing have been very helpful,
but one person in particular helped me in tricking ArgyllCMS
into producing these camera emulation profiles: Klaus Karcher,
without his help, ColorMatch may never have existed.


Donate
======
ColorMatch critically hinges on tools provided free of charge
by ArgyllCMS, so if ColorMatch has been useful for you, please 
seriously consider donating to ArgyllCMS' author:

http://www.argyllcms.com/


Frequently Asked Questions
==========================
Q: My camera does not support RAW+JPG
A: RAW files have a lower-quality embedded thumbnail, which you
   extract using Exiv2:
   # exiv2 -ep3 IMG_1234.CR2
   This embedded thumbnail might however be in sRGB colorspace
   (regardless of camera configuration).

Q: My camera does not support AdobeRGB
A: sRGB could work too, but you'll have to modify the script 
   accordingly.

Q: My camera does not support 1/3EV increments
A: You really need this precision to easily get the right shot,
   presumably you could do without, but be prepared to do a 
   huge amount of trial and error. It won't be fun.

Q: Can ColorMatch work with other targets
A: ColorMatch should work well with it's own self-print target
   and Wolf Faust's C1 IT8 target. Limited testing seems to
   indicate that LaserSofts DC Pro target works fairly well
   too. Other targets may work as well but haven't been tested.

Q: Why no TIFF compression
A: Depending on your version of ArgyllCMS it may or may not
   have been linked against a version of libtiff with deflate
   support. Disabling compression means you can be sure your
   TIFFs will be compatible.

Q: Can profiles be used interchangeably between RAW converters
A: Since RAW files aren't self-descriptive, decoding a RAW,
   requires RAW converters to apply arbitrary parameters to
   be able to make sense of the data. This may vary between
   different RAW converters; it may match for some camera
   models, and it might differ for others.

Q: Will there be a repository of generated profiles
A: I currently have no desire nor time to curate a repository
   of camera profiles. These resulting profiles should be
   considered a personal-use item.

Q: My Linux distribution does not have shared-color-targets
A: You merely need to download R080505.it8 manually, and
   modify the script accordingly. In this particular
   use-case it typically won't have to match the text
   on your actual target.

Releases

No releases published

Packages

No packages published

Languages