How to find 18% grey

DT 4.4.2 on linux.

Is there a way of highlighting/selecting just the mid-grey (18% grey) without a grey card on an old photo?

I was thinking of some parametric mask. I tried but…

Thank you

Not really, because 18% grey is a function of the surface, and requires a priori knowledge of that surface.

The closest you can get is 18% of full sensor clip point, which IS useful for an image that was originally exposed so that 18% grey card = 18% of sensor clip point (basically able to handle anything but specular highlights without clipping).

Alternatively, a floating point value of 0.18 is frequently useful as a target anchor for midtones - but in many cases, the flow is not “choose value that is 18% grey”, it is “choose exposure compensation so that your desired midtones after white balance is applied land at 18%” - and the easiest way of doing this is… A grey card that serves as a known reference for what is SUPPOSED to be 18% grey. Otherwise you’re just guessing/making an aesthetic/artistic choice.

I think there are maybe two questions here.

If it’s about how to set middle gray value for a photo that doesn’t include a reference card, and you’re using the scene-referred filmic workflow, I’ve found this FAQ bullet point quite helpful. TL;DR is by using the color assessment mode alongside the gray theme, you should simply aim to match average brightness.

If you’re wondering how to visualize which pixels are currently at the middle gray value, I don’t think there’s an ‘out-of-the-box’ way to do that in darktable. I’ve created a preset for the ‘rgb curve’ module that only ‘lights up’ the middle gray values, so as I move exposure around, I can see what parts are at middle gray. I think this is a correct way to do this, since the values are at 50% lightness using the Lab color picker, and stay there when I switch back to using filmic. I’d also be interested if there’s a better way to visualize this. The same values can be parametrically selected using the gray slider and picking a narrow range that centers around 18.

rgbcurve_middle gray.dtpreset (1.1 KB)

Image credit: @BenBeau from this PlayRaw thread.

Alternatively, you could look into using something like a false color LUT to highlight regions based on lightness.

4 Likes

While you can have a surface that’s equivalent to 18% gray in any image, there’s no way to know which part of an existing image is 18% gray, unless you have extra knowledge about the image. The whole idea of a gray card is to provide a known surface, on which to set your exposition (either when shooting or later in post).

That said, you don’t really need to know which part is middle gray, it’s a choice you make in post (it’s where you set your mid tones). Excepted of course when you need exact reproduction. In which case you need reference patches in (some of) your shots (some, if lighting conditions are constant).

Setting the proper part of your image to 0.18 luminosity is relevant for several modules in darktable, which use that value as an invariant point. E.g. filmic will always translate 0.18… luminosity in scene-referred input to 0.5 in display referenced outout). And that also determines which tone ranges will be compressed to fit in the output range.

1 Like

One way to pick what “ought to” be around mid grey would be

Middle gray: clear north sky; dark skin, average weathered wood

according to the Zone System.

Have fun!
Claes in Lund, Sweden

1 Like

Something you can try is:

  • Decide what you want to be at middle grey exposure level in your image
  • Turn on the color assessment tool
  • Turn on the monochrome module to eliminate color considerations
  • Tweak exposure to get what you want to be middle grey exposure to match the color assessment grey frame.
  • Remember the exposure value, then turn off the color assessment tool and the monochrome module.

This may or may not be helpful but it’s an interesting test for your eyes. I did this for a little while when AP was heavily advocating the importance of nailing middle grey to make Filmic RGB perform well, but ultimately I dropped the procedure because it wasn’t giving me better images (to my taste).

3 Likes

I actually find using the auto pipette set to 50% pretty good as a tool to set basic exposure I will just initially set it for the whole image esp if its not too biased tonally. Often that’s a great start so I can leave it and start to edit or if it is not a good result then my second step is to draw the ROI on a part of the image that I want nicely exposed, a face or whatever and see what that gives after one or two spots I usually land on a good starting exposure and I can then turn on filmic and finish the tone corrections. I found doing this I was pushed often to add more exposure to the image than I would have on my own if I just started with the sliders to add or subtract exposure and I got much more out of the images.

5 Likes

Sorry to ask the question but:

How do you do that?

  • I know about the pipette but how do you set it to 50%?

Thanks

I’ll go one step further: which pipette are you referring to as the “auto pipette”?

Plus:

what are you referencing with “ROI”?

Its there by default…clicking the pipette in exposure will set exposure to 50% based on the area chosen… by default that is the entire image…

2 Likes

It can be a face or a person or building or maybe If there is a really large bright area I will exclude some of that…then you end up with a nicely exposed image and you reel in the highlights with filmic…

So…guessing…“region of interest”? (i.e., I wasn’t sure what your acronym was referencing)

Sorry yes I apologize I thought that was a pretty excepted acronym…my mistake… thanks…

1 Like

The return on investment of that acronym wasn’t as high as you thought!

8 Likes

Just tried this sequence on a PlayRaw image. Super fast!

Oh I love that… great Friday laugh… thx

2 Likes

Thanks. I didn’t know that :grinning:

ROI - Indeed, from where I am coming from ROI was always region of interest whatever the context, but I have come to realize that most of the world sees it as the other def. As one of my supervisors says, TGIF, which, of course, I had to look up.

I like how you aren’t afraid to ask questions. You are definitely a person to follow for people who want to know things about software. :+1:

2 Likes

It’s sort of part of the exposure spot mapping…if you set to measure it takes a sample and then if you set to correct it does exposure mapping….

By default its on 50% and correct so you get a sort of autoexposure effect… I experimented between using 50% and 60 % as my starting point

1 Like

Incidentally, I find this a nice value for faces in portraits.

3 Likes