Profile application after opening file

I have been experimenting with the histogram-matching script by agriggio and the colour tone.
In the example below I have loaded the raw image, set the Profile to neutral, and loaded the pp3 file with the tone curve produced by the histogram-matching script. This produced a very good luminance match to the camera jpeg, but the skin tones were reddish and a bit over saturated.

I always set my Nikon D7000 to the the neutral picture setting (as opposed to Portrait or Vivid ect.)
So I tried setting the RT Color management Input Profile to ā€œNikon D7000 camera Neutral.dcpā€ and turned Look-up table on, Tone Curve off. The only other setting change is the Lens Distortion profile is set to auto.

This produced a very close color match. Previously I have not found the Nikon sourced .dcp files useful, however with the correct luminance curve, they seem add the required color corrective. The image on the left is the camera jpeg embedded in the raw file displayed using gThumb, on Ubuntu Linux.

Here is an example-

@David_Wilson I havenā€™t checked @agriggioā€™s script but I am pretty sure that histogram matching is a global operation. Skin tone is likely the first thing people would notice that is off. The skin needs to be masked away and edited separately for the time being, until @agriggio does some more wizardry.

@afre the original script matches on (srgb) luminance only. here is a version that can work also on individual channels:
histogram-matching.py (7.2 KB)
use -m RGB for that.
as I wrote previously, the results I got were far from spectacular thoughā€¦
also, if you have scipy installed the new version can take advantage of that to (try to) produce better curves

Afre,
I think you misunderstood my point. The histogram-matching did the global operation with the luminous tone curve. I was trying to say that that I only needed to apply the ā€™ Nikon D7000 camera Neutral.dcpā€™ adjustment to the skin colour to get a very close match to the original camera jpeg. My point was that this required only two simple operations.

@David_Wilson Just thinking aloud that histogram matching can shift colors in an undesirable fashion, which can make skin color unpleasant.

@agriggio I think changes in luminance can still mess up skin but in more subtle ways. Thanks for exploring peopleā€™s ideas from time to time :+1:.

absolutely. just change the tone curve type in RT and you will see (quite big, sometimes) changes in hues as well
tbh, this was just an experiment on my side and I was very surprised by how well it worked for me. I expected much worse given the simplicity of the approach. but sometimes simple is enough :slight_smile:

Yes, keep it simple :sunglasses:. Reminds me of how people have to apply special makeup to look good on TV (or on stage), especially back in the black and white days.

gThumb isnā€™t color managed image viewer => the same image will look different if youā€™re using color management in RT.

Does it work also on the RGB channels, meaning on the luminance also?
Or does it just work on the RGB channels?

It will produce 3 tone curves for the R, G and B channels respectively, i.e. the output pp3 will have the ā€œRGB curvesā€ activated, without changing the tone curve in the exposure tool.

Awesome thank you!! :slight_smile:
It is exactly what I asked for here:

I wasnā€™t aware of that, but youā€™re welcome :slight_smile:
Honestly though, the results arenā€™t that great most of the timeā€¦ but maybe youā€™ll have better luck.

Very, very interesting thread. Iā€™ve already put ā€˜histogramā€™ and ā€˜cdfā€™ operations in my img program to get data to play with in a spreadsheet, but Iā€™ll not have more time for a bit until we get past a house crisis (remember, having a house is having a hobbyā€¦ :slight_smile: )

I donā€™t know how Nikon, for instance, packages all the operations in their profiles. Luminance is pretty straightforward, tone curve. Saturation is another thing, may not be capture-able in the histogram difference. Sharpening is obvious, that wonā€™t show up well in the histogram.

Iā€™d surmise you can probably find all of the OOC JPEG settings somewhere in most camerasā€™ raw files, and their corresponding PP software assembles all them and applies them with an operation equivalent with the in-camera firmware. Luminance is probably the only one of these that can be reliably reconstructed with histogram matching.

That said, what Iā€™m considering (you really do need something to think about when youā€™re crawling around under your houseā€¦) is a separate mode of my ā€˜blackwhitepointā€™ tool in rawproc that, instead of contrast-stretching, applies histogram matching using whatever JPEG I can pull out of the raw file. This would allow using histogram matching to not only adjust the difference in luminance from a ā€˜neutralā€™ to camera setting, but also to scale the linear image, do both in one operation.

@agriggio, right now I subscribe to GPL V2 for rawproc, but Iā€™d encapsulate the algorithm and ascribe it to GPL3 or later, per your declaration.

Okay, back to the dirtā€¦

feel free to use GPL2 if you prefer, no problem on my side ā€“ Iā€™m not very picky about that :slight_smile:

Did you take care of the rgb encoding of the embedded jpeg? At least on my Nikon I can set it to Adobe RGB or sRGB (for the jpeg).

No, but I use sRGB on my camera, and stillā€¦

@agriggio Ok, just wanted to exclude it :slight_smile:

And thanks to @agriggio , the histogram matching function made its way into the dev branch :grinning:

RawTherapee_dev_5.3-511-g5342e752_WinVista_64.zip

is available at
https://keybase.pub/gaaned92/RTW64NightlyBuilds/

Click on ā€œauto matched tone curveā€

2 Likes