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.
@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.
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
Yes, keep it simple . 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.
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.
I wasnāt aware of that, but youāre welcome
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ā¦ )
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.