Please: practical advice on colour profiles and histograms

Dear all,

I know far too little about the practical aspects of colour profiles
and how they affect photo processing possibilities – i.e. practical
aspects as opposed to the theoretical ones.

What software setup would you recommend me to use?

Sincerely,
Claes in Lund, Sweden

I always end up back on @Elle’s site: https://ninedegreesbelow.com/ which is a fantastic resource for color management. Bonus: she’s here :smile:

1 Like

Hi Claes,

instead of giving you recommendations for practical setups, I will try to provide you some examples of what result you get from a given adjustment and for different choices of the RGB colorspace. If you don’t mind, I will post examples every now and then, when time allows and/or when I get some good new idea for new use cases.

Let’s start from one of the simples adjustments: exposure compensation. It boils down to multiplying the RGB components by the same factor, which is expressed in powers of 2. For example, a 2-stop exposure increase corresponds to a multiplicative factor of 4. In the following I will apply this 2-stop adjustment to images in different colorspaces, with almost self-explanatory results…

Original image:

Image in standard sRGB colorspace, +2 exposure compensation:

Image in REC2020 colorspace with REC709 gamma encoding (the default), +2 exposure compensation:

Image in linear sRGB colorspace, +2 exposure compensation:

Image in linear REC2020 colorspace, +2 exposure compensation:

Notice how the first two images look different, due to their different gamma encodings, and how they both look “wrong”. The result of exposure compensation on linear RGB images looks instead correct and is the same regardless of the colorspace.

The bottom line: if you need to apply an exposure compensation, the correct choice is to work with linear gamma RGB data.

4 Likes

Claes, this is something that’s buzzing round my head too. I nearly started writing after your post a few days ago but didn’t find the time in the end.

RT is really good and I expect it will be my mainstay for a good while yet.

However I’ve been thinking : what is the ultimate workflow? Is that what you have in mind by “software setup”?
There’s a lot I don’t know also, but I’m thinking:
Raw conversion: Like @Elle mentioned the other day, use UFRaw or similar to decide the white balance, and note the factors. Then use Elle’s 32bit version of DCRAW to do the demosaicing, outputting 32bits of course, probably linear gamma (but I need to do some homework here).
Subsequent edits: Recent Gimp using the relatively new features for most beautiful colours etc!

It would be nice if RT could output 32bit (as recently suggested) and maybe was better at showing out-of-gamut areas.

I should admit I know nothing about Darktable, precious little about Photoflow, and nothing about various other FOSS apps which feature in Pixls.

P.S. Was typing whilst Carmelo Dr Raw posted…!

No worries, people. It takes time to learn. I pretty much knew nothing a year ago. There is no ultimate workflow per se. It is just knowing what your expectations are and finding the right tools to fulfill them. Not the other way around.

Hmm, sadly my floating point version of dcraw doesn’t support newer cameras, and it also doesn’t actually output 32f, only 16i. I’d love to update it and figure out how to output floating point, in addition to doing all the internal calculations using floating point, and add the wonderful new RCD algorithm, and also DCB, but I just don’t have the time.

@Elle I would appreciate an update (please x3), only when you have the time :wink:. With this update, could you provide an option not to use a camera profile?

As Carmelo_DrRaw illustrates, multiplying values by a some number has different effects in a linear image compared to an sRGB image. Two stops in linear is a multiplication by four. But the same two stops in sRGB is a multiplication by 1.878, more or less, 4^(1/2.2).

So exposure compensation is simply a different number. To anyone who adjusts exposure by multiplying, don’t use two-to-the-power-stops in sRGB. (Personally, I don’t adjust exposure by multiplying, because my image by then spans the full range from black to white, and multiplying would cause clipping. But we could consider a process that automatically stretches to the full range to be an automatic exposure correction.)

To me, a more important difference is in colour mixing. This obviously applies when painting, but also when processing photos: changing the size, blurring, sharpening and so on, any operation where output pixels depend on more than one input pixel. In these cases, doing the operation in linear or sRGB will give different results. But these differences may not be visible.

And colour representation can make a big difference to colour mixing – do we use channels that represent red, green and blue, or Lab, LCH or whatever? I expect profiles also make a difference, though I have less experience there, almost always using sRGB.

@snibgo Indeed! I think that 95% of my questions stem from the fact that I am trying to learn how to use color spaces other than sRGB and linear sRGB. I also habitually “exposure compensate” by stretching the range, but that would probably affect the colors, wouldn’t it?

Stretching the range of RGB channels (whether linear or sRGB) increases contrast and saturation but not hue. Any tonal change, when using RGB channels, will change contrast and saturation.

1 Like

I cannot refrain from some advertising of my own raw developer :wink:

Photoflow allows to open most of the old and recent RAW images, apply some of the state-of-the-art demosaicing algorithms (Amaze, LMMSE, IGV and now also RCD), bypass color management by outputting the demosaiced data in the camera color profile (which is then embedded in the output file for a correct and consistent workflow if further processing is needed), apply lens corrections directly after the demosaicing phase, and finally save 32f TIFFs than can be opened in GIMP or other image processors.

All what @RawConvert has described, in one single step…

I’d better try out Photoflow! (And re. the RCD changes tonight, it’s just great the way you and @agriggio and people get this stuff done, thanks)

@snibgo, curious, how do you yourself adjust exposure?

Though this still leaves me (and @Claes ?) wondering how best to proceed. To combat this, I’m therefore looking for a great process which will deliver great tones and colours (assuming the raw input is good!) and which enjoys some sort of concensus among the experts, then I can just get on with processing my pics. Ideally…!

The how is actually in our discussion. We basically stretch the values to fit the range; e.g., [0…255] for 8 bit images and [0-65535] for 16 bit. So if you have an image that goes from 2-187, the idea is to stretch it to 0-255 or 2-255, depending on what you want to do.

In G’MIC it is as easy as normalize 0,255. In ImageMagick, there are a few options; e.g., -auto-level. To be absolutely clear, this isn’t an exposure adjustment per se because exposure isn’t viewed in this manner; e.g.,

i.e., (2^stops)^(1/gamma), or 2^(stops+(1/gamma)).


Edit: Made my advice more concise.

General advice can only go so far. Different apps have different feature sets. Experiment with each app to see if it meets your needs. Determine what you would like to learn and what your goals are. It may take a while before you have enough knowledge and practice to ask the right questions.

Lastly, I and others in the forum have asked many questions and have had many discussions. It would probably be a good idea to use the search function :wink:.

My raw development (with dcraw and ImageMagick) ends with a 16 bit/channel colour-balanced image with values from 0 to 65535, and sensible contrast. It usually also creates a version with adaptive histogram equalization in 2x2 tiles (as documented in Adaptive auto level and gamma). I’m considering adding an automatic Crop to detail, because it often suggests ideas I hadn’t thought of.

Automatic tonal adjustment is by power curves and/or sigmoidal (S-shaped) curves. I usually care about the overall lightness (the mean) and the contrast (the standard deviation). I haven’t yet found an algorithm for the computer to decide what the overall lightness should be – low key, high key, whatever.

For adjusting tonal levels (lightnes and contrast) manually, I use curves, typically adjusting the L channel of Lab. That’s the overall control, but it might need local control, which gets messier.

FWIW, I don’t a perfect tool or system exists. Digital visual arts, including photography, is still quite young. We are all learning. We do stuff and see what we get. We look at what other people are doing and think, yeah, I’ll try that.

@snibgo Nice Crop to detail page. Will take a look when I find the time. I do something similar to help me decide which images to cull.

@RawConvert @Claes To complete my train of thought, I believe that many of us on discuss realize that photography should be made more accessible to the general public. We have had discussions on developing a wikibook and have been encouraging more tutorials to be written (@McCap has been on fire lately) . I will eventually write an intro to PhotoFlow, at least on the Raw Developer layer, if no one else does it first (maybe @chroma_ghost will; I mean look at what he does in his PlayRaws!).

1 Like