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.
Okay, back to the dirt…