18% Gray code value in 16 bit Linear RAW?

Started 3 months ago | Questions
Mandem Junior Member • Posts: 28
18% Gray code value in 16 bit Linear RAW?

The camera's maximum limit in terms of Dynamic Range is 2000% Scene Reflectance. What would the code value of 18% scene reflectance gray be in a 16bit Linear Raw File? Thanks

ANSWER:
spider-mario
spider-mario Contributing Member • Posts: 946
Re: 18% Gray code value in 16 bit Linear RAW?
1

If you have measured that the raw file clips at 2000% diffuse reflectance then 18% reflectance would presumably be 18/2000 of the way between the black point and the clipping point, so at “black point + (18/2000) × (maximum value − black point)”. Assuming that the full 16-bit range is used, the maximum value would be 65 535, and so the code value for 18% would be “black point + (18/2000) × (65 535 − black point)”.

 spider-mario's gear list:spider-mario's gear list
Canon G1 X III Olympus TG-6 Olympus E-M1 II Olympus E-M1 III Canon EOS R6 +15 more
selected answer This post was selected as the answer by the original poster.
OP Mandem Junior Member • Posts: 28
Re: 18% Gray code value in 16 bit Linear RAW?

spider-mario wrote:

If you have measured that the raw file clips at 2000% diffuse reflectance then 18% reflectance would presumably be 18/2000 of the way between the black point and the clipping point, so at “black point + (18/2000) × (maximum value − black point)”. Assuming that the full 16-bit range is used, the maximum value would be 65 535, and so the code value for 18% would be “black point + (18/2000) × (65 535 − black point)”.

Thanks for that. You put black point instead of 0 because you're assuming that code value 0 isn't necessarily black correct? If it was then it would just be 18/2000 x 65 535?

Another question(although unrelated but perhaps you could help as I'm a bit lost). When discussing Color Space Transforms, it is said that the encoded image/video is "Linearised"(I am mainly talking about video). Is this what they mean? Or is that something else entirely different?? Words like Linear, Floating Point Operations etc... start popping up. I'm mainly trying to understand what is the difference between Linear RAW shooting and Linearizing for Color Space Transforms(Very confused about this). This is all from Davinci Resolve's point of view.

Iliah Borg Forum Pro • Posts: 28,760
Re: 18% Gray code value in 16 bit Linear RAW?
5

Mandem wrote:

The camera's maximum limit in terms of Dynamic Range is 2000% Scene Reflectance. What would the code value of 18% scene reflectance gray be in a 16bit Linear Raw File? Thanks

18% has no special meaning for raw.

-- hide signature --
57even Forum Pro • Posts: 15,776
Re: 18% Gray code value in 16 bit Linear RAW?

Iliah Borg wrote:

Mandem wrote:

The camera's maximum limit in terms of Dynamic Range is 2000% Scene Reflectance. What would the code value of 18% scene reflectance gray be in a 16bit Linear Raw File? Thanks

18% has no special meaning for raw.

True, but are all video file formats gamma encoded?

OTOH, "linear" may just be a reference to the tone-curve.

Not knowledgeable about video formats to know either way.

-- hide signature --

"A designer knows he has achieved perfection not when there is nothing left to add, but when there is nothing left to take away." Antoine de Saint-Exupery

 57even's gear list:57even's gear list
Fujifilm X-Pro2
Entropy512 Veteran Member • Posts: 5,299
Re: 18% Gray code value in 16 bit Linear RAW?

Mandem wrote:

spider-mario wrote:

If you have measured that the raw file clips at 2000% diffuse reflectance then 18% reflectance would presumably be 18/2000 of the way between the black point and the clipping point, so at “black point + (18/2000) × (maximum value − black point)”. Assuming that the full 16-bit range is used, the maximum value would be 65 535, and so the code value for 18% would be “black point + (18/2000) × (65 535 − black point)”.

Thanks for that. You put black point instead of 0 because you're assuming that code value 0 isn't necessarily black correct? If it was then it would just be 18/2000 x 65 535?

Yup.  For various reasons, many sensors (most modern ones) have black correspond to a nonzero ADC value.

(This allows ADC noise to not be mirrored around zero, which makes it somewhat easier to handle noise and/or black point shifts/offsets in postprocessing - and yes, black points often shift slightly depending on the exact sensor configuration.)

Another question(although unrelated but perhaps you could help as I'm a bit lost). When discussing Color Space Transforms, it is said that the encoded image/video is "Linearised"(I am mainly talking about video). Is this what they mean? Or is that something else entirely different?? Words like Linear, Floating Point Operations etc... start popping up. I'm mainly trying to understand what is the difference between Linear RAW shooting and Linearizing for Color Space Transforms(Very confused about this). This is all from Davinci Resolve's point of view.

Fully raw sensor data is almost always linear (nonlinear ADCs exist but are extremely rare, logarithmic/nonlinear representation is often used as a basic form of lossy compression), in what is often referred to as "camera native" gamut (which is a function of the spectral sensitivity function of the CFA filters and underlying photosites), and Bayer-mosaiced (each pixel value corresponds to only an R, G, or B sample)

If you linearize something with the CST plugin, you will wind up with:

Linear data (some operations are best performed on linear data - for example exposure compensation is a simple multiplication on linear data)

Some gamut other than camera-native (Manufacturer-specific gamuts like S-Gamut and the like aren't camera native - sometimes they're close to camera-native for one particular model, but are not native for all models.  Alternatively they may be in a more standardized gamut like Rec2020 or Rec709)

The image data will be demosaiced - each pixel has R, G, and B values (which may have been generated by interpolation/demosaicing of a Bayer CFA)

(Side note - they are now rather rare, but video cameras that use three sensors and dichroic prisms to split colors do exist - in fact they were typical/standard back in the early days of color television but have largely disappeared.  These don't need to be demosaiced but do sometimes need R, G, and B channels to be slightly scaled or aligned.  It's extremely unlikely you'll run into video from such a source nowadays though...)

-- hide signature --

Context is key. If I have quoted someone else's post when replying, please do not reply to something I say without reading text that I have quoted, and understanding the reason the quote function exists.

 Entropy512's gear list:Entropy512's gear list
Sony a6000 Pentax K-5 Pentax K-01 Sony a6300 Canon EF 85mm F1.8 USM +5 more
xpatUSA
xpatUSA Forum Pro • Posts: 20,393
Re: 18% Gray code value in 16 bit Linear RAW?

Iliah Borg wrote:

Mandem wrote:

The camera's maximum limit in terms of Dynamic Range is 2000% Scene Reflectance. What would the code value of 18% scene reflectance gray be in a 16bit Linear Raw File? Thanks

18% has no special meaning for raw.

Especially with the introduction of the SOS-based ISO definition ... which itself has become less useful with the increasing popularity of REI.

In other words, 18% is now whatever Chuck Norris or the Manufacturer says it is.

And back in the day when mid-gray was invented, Kodak said it was 16% anyway!

-- hide signature --

Just interested in the technology.

 xpatUSA's gear list:xpatUSA's gear list
Panasonic Lumix DMC-LX1 Sigma SD9 Panasonic Lumix DC-G9 Panasonic Leica DG Macro-Elmarit 45mm F2.8 ASPH OIS Sigma 17-50mm F2.8 EX DC OS HSM +14 more
Bernard Delley Senior Member • Posts: 1,770
please, be more educational
2

xpatUSA wrote:

Iliah Borg wrote:

Mandem wrote:

The camera's maximum limit in terms of Dynamic Range is 2000% Scene Reflectance. What would the code value of 18% scene reflectance gray be in a 16bit Linear Raw File? Thanks

18% has no special meaning for raw.

Especially with the introduction of the SOS-based ISO definition ... which itself has become less useful with the increasing popularity of REI.

In other words, 18% is now whatever Chuck Norris or the Manufacturer says it is.

And back in the day when mid-gray was invented, Kodak said it was 16% anyway!

do not let the reader guess or google what the abbreviations may mean . Tell what it is about. Common and useful abbreviations can be taught too. I guess a term like saturation based ISO definition

SOS sure not ...---... distress

REI sure not Recreation Equipment Inc

LoL

 Bernard Delley's gear list:Bernard Delley's gear list
Nikon D7200 Nikon D500 Nikon D850 Nikon AF-S Nikkor 14-24mm f/2.8G ED Nikon AF-S Micro-Nikkor 60mm F2.8G ED +10 more
xpatUSA
xpatUSA Forum Pro • Posts: 20,393
Re: please, be more educational
1

Bernard Delley wrote:

xpatUSA wrote:

Iliah Borg wrote:

Mandem wrote:

The camera's maximum limit in terms of Dynamic Range is 2000% Scene Reflectance. What would the code value of 18% scene reflectance gray be in a 16bit Linear Raw File? Thanks

18% has no special meaning for raw.

Especially with the introduction of the SOS-based ISO definition ... which itself has become less useful with the increasing popularity of REI.

In other words, 18% is now whatever Chuck Norris or the Manufacturer says it is.

And back in the day when mid-gray was invented, Kodak said it was 16% anyway!

do not let the reader guess or google what the abbreviations may mean . Tell what it is about. Common and useful abbreviations can be taught too. I guess a term like saturation based ISO definition

SOS sure not ...---... distress

REI sure not Recreation Equipment Inc

LoL

Good snipe.

I was replying to Iliah who for sure knows what they mean and probably understood my point.

Must be more explicit in future ...

-- hide signature --

Just interested in the technology.

 xpatUSA's gear list:xpatUSA's gear list
Panasonic Lumix DMC-LX1 Sigma SD9 Panasonic Lumix DC-G9 Panasonic Leica DG Macro-Elmarit 45mm F2.8 ASPH OIS Sigma 17-50mm F2.8 EX DC OS HSM +14 more
Keyboard shortcuts:
FForum MMy threads