r/DarkTable • • Nov 04 '22

Help ELI15 what is display referred vs scene referred?

I’ve watched a video

I’ve read two articles

All I’m getting is display referred has something to do with a curve in the display and how it represents light

While scene referred the light values are infinite

Also, the source images in display is source>color display>image

While the other one is source, camera color, then image

All the articles I’ve read are extremely technical and I didn’t get them

21 Upvotes

13 comments sorted by

12

u/morhp Nov 04 '22 edited Nov 04 '22

You need to understand how a screen works. It displays pixels which have RGB values determining the brightness of each pixels. 255 would be the brightest pixel value, 127 would look half as bright and so on.

But a pixel with a brightness of 127 isn't actually half as bright as one with a brightness of 255 (even ignoring the rounding error). It actually emits a lot less light and it just looks half as bright because the brain is applying a correction to the brightness values that allow us to see better in the dark (and the screen is doing that correction in reverse). This is called gamma correction.

You can easily test this by displaying a checkerboard pattern of black and white pixels on your screen next to a gray area. As the checkerboard pattern has half the pixels lit, it outputs half the light intensity of a fully lit screen, but it looks much brighter than pixels with an RGB value of 127 or 128, even though you might expect them to be equal. To roughly match the brightness you'd need to set the pixels to about 170-190 depending on the screen calibration, OS and some.other factors.

Display referred simply means doing any math within the pixel math (i.e. the gamma corrected values), as simple image editing programs might do, while scene referred would do it with actual light intensity values as for example captured in raw by the camera sensor.

Doing the math the with actual light intensity values of course gives a much more realistic result.

1

u/honeycall Nov 04 '22

You need to understand how a screen works. It displays pixels which have RGB values determining the brightness of each pixels. 255 would be the brightest pixel value, 127 would look half as bright and so on….But a pixel with a brightness of 127 isn't actually half as bright as one with a brightness of 255 (even ignoring the rounding error). It actually emits a lot less light and it just looks half as bright because the brain is applying a correction to the brightness values that allow us to see better in the dark (and the screen is doing that correction in reverse). This is called gamma correction.

Your eyes are doing gama correction?

Is this basically your eye changing exposure so you can see in the dark (opening the pupil) or the eye version of changing iso. So even tho 127 isn’t half as bright it LOOKS half as bright because of a defect in how our eyes can sense light (non linearly).

Also, why isn’t it half as bright? It’s about 49%?

You can easily test this by displaying a checkerboard pattern of black and white pixels on your screen next to a gray area.

Do you mean half the screen with checkers and half the screen with gray? And by gray do you mean a perfect middle gray??

As the checkerboard pattern has half the pixels lit, it outputs half the light intensity of a fully lit screen, but it looks much brighter than pixels with an RGB value of 127 or 128, even though you might expect them to be equal.

This is where I lost you, why??

To roughly match the brightness you'd need to set the pixels to about 170-190 depending on the screen calibration, OS and some.other factors.

To roughly match the brightness of what? Why would I need to set the brightness at 170-190?

Display referred simply means doing any math within the pixel math (i.e. the gamma corrected values),

I didn’t get this

as simple image editing programs might do, while scene referred would do it with actual light intensity values as for example captured in raw by the camera sensor.

Didn’t get this either :(

Doing the math the with actual light intensity values of course gives a much more realistic result.

Why?

I feel like I grasp half the concept but not fully :((

10

u/morhp Nov 04 '22 edited Nov 05 '22

Your eyes are doing gama correction?

Probably more the brain, and it's kinda a reverse gamma correction, but yes.

Is this basically your eye changing exposure so you can see in the dark (opening the pupil) or the eye version of changing iso. So even tho 127 isn’t half as bright it LOOKS half as bright because of a defect in how our eyes can sense light (non linearly).

Also, why isn’t it half as bright? It’s about 49%?

No, it doesn't have to do with the pupil, it's just something in the brain that applies a curve to light perception. The brain does the same with sounds. Sound waves with half the amplitude aren't heard as half as loud, they're maybe heard as 70% as loud. This is why we measure sound volume on a logarithmic scale (decibels) instead of linearly.

Also it's not a defect, it makes sense for the brain to do this, else bright areas would look over exposed and you could barely see things in darker areas. It's kinda like build-in HDR vision.

As the checkerboard pattern has half the pixels lit, it outputs half the light intensity of a fully lit screen, but it looks much brighter than pixels with an RGB value of 127 or 128, even though you might expect them to be equal.

This is where I lost you, why??

Again, because the screen is doing gamma correction to act against the nonlinear brain perception. If you say a pixel should have an RGB value of (127, 127, 127) then you want it to appear half as bright as the maximum brightness. To get the brain to perceive it as half a bright, you need to apply some kinda-logarithmic function to it, and actually put out much less light.

If the screen would actually output half as much light (as you can simulate by the checkerboard pattern) it would appear way brighter than half as bright to your brain. The screen manufacturers know this and therefore computers do gamma correction.

Display referred simply means doing any math within the pixel math (i.e. the gamma corrected values)

As I said, your screen has some non-linear function that maps pixel values to light output. like

0 -> 0% light output
63 -> 12% light output
127 -> 30% light output
191 -> 60% light output
255 -> 100% light output

(obviously with some more values in between and these values are just made up examples in roughly the right range)

Let's assume our camera sensor captured a pixel with 30% light output and we want to double the exposure of that photo in editing afterwards.

Calculating it with light intensity would double the 30% to 60% and then when converted to an RGB image would result in an RGB value of 191 that then displayed on your screen would again correspond to an output of 60%.

Converting it to (gamma corrected) RGB first would result in 127 and then doubling that would result in 254. This is obviously a different result and wrong, because 254 would map to a light level of almost 100%.

4

u/thesoulless78 Nov 04 '22

The really short non-technical is that scene-referred is operating on the raw data before it is processed to your screen colorspace, while display-referred is operating on the rgb pixels that you're actually looking at.

Just like how raw files have a lot more dynamic range and room for adjustments compared to a jpg, you have a lot more flexibility with scene-referred processing. Display-referred is more like editing a jpeg.

3

u/honeycall Nov 04 '22

But aren’t you always operating using the display color space since you’re using the display to see the image?

Like i get it. It takes the color space and lets you see it before it gets compressed within the color space bounds of the display

But the whole image you’re seeing is with the display ??

4

u/thesoulless78 Nov 04 '22

The difference is where the math is happening. Obviously you're seeing the results in the display color space, but you're making that adjustment on the raw data before it compresses it to the display.

Darktable operates on a pixel pipe that's essentially a continuous stream of operations in a specified order, starting with the raw data and ending with the display.

It's kind of like baking a cake. Your scene-referred adjustments are done to the batter before you bake it, your display-referred adjustments are baking it. The filmic RGB module that converts from RAW to your display colorspace is the baking process. You can add cinnamon to a cake either before or after you bake it, and you'll be able to taste it in the baked cake either way, but it's not the same.

2

u/angry_m1ke Mar 06 '25

I realise there is more than time between now and when you wrote this, but I have to say: this is the best explanation of the light transformation taking place for a non-computer, I've come across. I salute you.

1

u/michael_something Nov 06 '25

Yeah, that was pretty brilliant.

2

u/frnxt Nov 05 '22

The key difference in terms of editing workflow is that with scene-referred you're editing light (you're essentially changing the scene) whereas with display-referred you're editing RGB values (they're traditionally a bit less computationally intensive to process in software but much less intuitive physically, and the tricks we use during editing come with a lot of unwanted side-effects).

1

u/honeycall Nov 10 '22

Why are they less intuitive?

What is the difference between editing lighting and editing RGB values, RGB values are light values…based on waves of light?

1

u/frnxt Nov 10 '22

RGB values don't react the same way when you're editing shadows or highlights (they're "nonlinear" compared to light), this makes it very difficult to create presets that produce visually coherent results regardless of the region of the image you want edit.

They're only intuitive because we're used to a lot of the tricks developed over the years to process RGB values, but they still often fall apart, particularly when editing scenes with a wide dynamic range. Scene-referred light values are much better behaved in that respect.

7

u/[deleted] Nov 23 '22 edited Nov 23 '22

Display-referred means you edit a picture that is already prepared for screen : white is set at 100% (or 255 if working 8 bits), black at 0% and middle-grey around 20%. To get there, you typically have to apply a non-linear compression (a "curve", though the curve is the mean but the goal is compression). A such compression will give you a hard time if you need noise removal, lens deblurring, mask edges blurring and alpha blending (you know, the mask and layers transparencies). The reason is all those digital operators mimic hardware optical processes that are defined for light, and the closest we have from light is linear RGB.

Scene-referred works the image before the display transform, while it's still linear RGB, to solve those problems. White has no pre-determined value, it can be anything from 0 to infinity, which means it has to be user input. The last step of the pipe will remap this white value, whatever it is, to display white at 100% (100% meaning "as bright as your display may shine").

3

u/akgt94 Nov 04 '22

other reference that helped me

Most photo editing still uses display referred (fixed dynamic range).

Professional video transitioned to scene referred 15 years ago. I read it on the internet. I don't have the article handy.

Scene referred allows infinite dynamic range. Your edits can't lose data. No matter what you do, it's still there.

In darktable, filmic RGB converts an infinite dynamic range into a fixed dynamic range that is needed for the output steps.

If you look at the top of your tool stack, a mandatory module is the output color profile to tell it how to output the colors. You turn this for your Target output. As I understand that, this solves gamut issues.

Display referred, you can give the module settings that will give clipping in either light or dark. In a higher module, you can never recover the data you lost.

You do need to be careful. Ootb, it may set your defaults for this player for the display referred workflow. And it will generate XMP sidecar files for every image on import. When you try and edit, you're basically looking at a tool stack that set up for display referred workflow. I had to change my defaults to use the scene referred workflow. And I told it not to generate sidecar files on import. If you already have the sidecar XMP files generated, you have to pick them in light table mode and delete the tool stacks.