I had a great picture of a lady I took under weird, complex lighting (sodium vapor and mercury vapor lights). Great smile, perfect focus, excellent picture except for way, way off color.
I monkeyed with temp/tint for an hour in adobe Camera Raw with no good result. I wrote a program to hack the sidecar XMP file varying the temperature and then creating a symbolic link to the original NEF named parallel to the XMP file.
This is NOT nearly as fancy nor as technically correct as the above answer, but instead throws a massive amount of CPU at the problem and gives some (possibly) interesting results.
This creates a bunch of .NEF file links and a real .XMP sidecar file for each. Just copy a real nef/xmp file combo to clone to the test directory and set the min/max temp and dif_temp (Kelvins between clones). Another loop can be inserted to vary the tint value at a constant Kelvin but the files generated will be multiplied by the number of tints.
Run Photoshop file -> scripts -> image_processor, point it to this directory and it will create a real tif/jpg/whatever for each link at the given color temp.
This code is a Dirty, Ugly Hack and running it will probably melt your processor while attracting ball lightning and killer bees to the immediate vicinity. No warranty goes without saying.
Requires Perl (surely used daily) and mklink (may be present).
sub color_temp_experiment() {
$nef = '6s-2014.1004-237695.acl.nef';
$xmp = '6s-2014.1004-237695.acl.xmp'; # crs:Temperature="6000"
$min_temp = 7800;
$max_temp = 9000;
$dif_temp = 200; # Difference in temp per loop.
$xd = `cat $xmp`; # Xmp Data;
($base = $nef) =~ s/\.nef//; # Basename common to both nef and xmp.
$ii = -1;
for($temp = $min_temp; $temp <= $max_temp; $temp += $dif_temp) {
$ii++;
$link = $base . ".$temp" . 'k.nef'; # Abuse Kelvins with lower case.
$xfn = $base . ".$temp" . 'k.xmp'; # Abuse Kelvins with lower case.
if(-f $link) {
print("Found FILE (s/b sym link!) $link. Next!\n"); # This prints!
next;
}
$cmd = "mklink $link $nef";
printf("$ii) Cmd = $cmd\n");
$sto = `$cmd`;
unless(-f $link) {
print("ERROR! Sym link $link not found!\n StdOut=<<$sto>>\n\n");
exit;
}
($xt = $xd) =~ s/crs:Temperature="\d+/crs:Temperature="$temp/ms;
open(O, ">$xfn");
print(O "$xt");
close O;
}
}
-color-matrix
option might get you started; see also: fmwconcepts.com/imagemagick/whitebalance/index.php \$\endgroup\$