Processing Questions

Shaw

Veteran
Hey guys,

This may seem obvious but I would like to discuss the benefits of RAW data acquisition. There are a few things I am not entirely clear on that I would like to figure out.

The main benefit of shooting RAW, as I see it, is the ability to choose your working format after the fact. Whether that's DVCproHD or some other format.

What I don't fully understand are these:

1) How does lossy (RedCode RAW) compression work with RAW data? How does that affect the color sampling if at all? Am I right in assuming that RedCode is lossy? I understand how lossless RAW compression would work but not lossy. This is, of course, assuming that by RAW you mean the data that hasn't yet been demosaiced? I just can't seem to wrap my head around how to demosaic a lossy compressed RAW file.

2) What exactly defines the RGB gamut used in RED? Am I correct in assuming that this is, at the lowest level, the RGB filter itself? The bit depth of the internal processing shouldn't have any affect on the size of the gamut correct? Is it possible to work with this, probably very wide, gamut in post for, say, a film transfer? What sort of format would be capable of handling that?

3) The camera will have standard LUTs available for compressing this gamut to Rec 709 etc, correct? I believe I read this somewhere on the forums.

Maybe I'm just confusing myself thinking too hard here! :)
 
First raw is not about format, but about color.

If you do not want format shoot uncompressed, that is an other thing.

Raw is sort of opposite to RGB, that means that when shooting raw you are not printing the information of the color temperature the gamma curve and stuff like that. All these operation are to be made in post production inside a software like REDCINE or any color correction software, like apple shake using for exemple the LogLin node.

The process to shoot RAW has been used since some years in still camera and is quite new in motion camera, the first I was aware of was the Viper.

For clearer explanantion google RAW or look to:
http://www.luminous-landscape.com/tutorials/understanding-series/u-raw-files.shtml

The camera will have standard LUT like Rec 709 and some others besides you can make your own LUT. All this stuff is only for viewing on set as it is not print on the footage.
 
1) because it's clever! Yes, it's still in it's raw bayer mosaic form, and yes, through clever work, it's very compressable, again, with care and understanding. After all it's just data in a pattern. Know the pattern and know the data and you can compress.

2) RGB gamut is defined by the colourimetry of the sensor and the choice of destination RGB space.

3) Yes. Although it would be LUT + Matrix.

Graeme
 
Well, I'm not sure I would say RAW isn't about format. Being able to choose your working format after the fact is a great benefit. Especially when you can pull several different variants from your 'negative'. Color is, of course, hugely important as well. :)

Gaeme, thanks for the response. A few more questions for ya: :)

1) Does this compression affect the debayering process and the potential color resolution of the camera? It just seems like compressing un-debayered footage must make the debayering process a bit less accurate and more complex.

2) That's what I figured. For a film type workflow though how would you maximize the size of the color gamut (pointless if you're stuck with Rec709 for HD of course)? I'm also rather curious why all these digital cameras use RGB rather than a perceptual format - especially since RGB values don't have any intrinsic meaning until given value by comparison in one of the CIE perceptual formats like color management tools do these days. I do understand that the camera is RGB by nature which probably is the only reason?

3) Doh! LUT + Matrix, right. The LUT in that case is just the usual gamma correction curve right? Also, any chance you have a resource with specs on the Rec709 color space? I'm curious how it compares to modern LCD panels which seem to all be more or less built around an sRGB space.

4) I'm also curious what you recommend for film transfers. I think 12bit lin would be best of course if space is no problem. What sort of image degredation would we be looking at to convert 10bit log to lin for image processing/grading? I suppose that's all relative to the conversion methodolgy?
 
2) What exactly defines the RGB gamut used in RED?
Presumably, you could target the XYZ color space and hence the entire visible gamut. I believe RAW lets you do this, since you don't apply the color matrix right away and therefore you don't clip any (out-of-gamut) colors. However, inaccuracies in the sensor's colorimetry (i.e. spectral response being dissimilar to the CIE CMFs) still means inaccurate colors.

Also, any chance you have a resource with specs on the Rec709 color space? I'm curious how it compares to modern LCD panels which seem to all be more or less built around an sRGB space.
Charles Poynton's book (see poynton.com) has some information on both color spaces.

Rec. 709 and sRGB share the same primary chromaticities (the color of red, green, blue that the monitor should have).
They have different transfer functions.
As far as storing the numbers, Rec. 709 uses Y'CbCr encoding with luma ranging from 16-235 (for 8-bit formats). The chroma ranges from 16-240. You get quantization noise along the wide, and the entire Y'CbCr space represents lots of illegal/impossible colors.

sRGB uses RGB encoding, with a 0-255 range (8-bit).

When converting between Y'CbCr and RGB encoding, you lose colors to quantization. As in, two very similar Y'CbCr values will produce the same R'G'B' value.
 
Last edited:
1) No. Just tested a 4k frame compressed to about 80kb. It looks yuck, but hey, it's 4k rez into 80k. Now I demosaic it, and it works, just like you'd expect, and the demosaic doesn't introduce any extra special artfacts beyond that produced by the initial over-compression. I'd say we're safe.

2) The gamut of RAW is undefined. It's not in any colour space, but it does produce an RGB image, but it's RAW and doesn't look "right". When recording RAW you've not chosen a target colour space, and hence have lost no gamut. It's only when you target, do you get some losses, but you also make the image look nice :) I guess it might be nice to stay in XYZ, but what software works for compositing in that? That's the problem!

3) Glenn's answer (as always - thanks Glenn) is good here. Obviously, the 709 target is for HD compatibility. For RAW processing, you can target whatever you want, really.

4) Don't worry at all about this. We've been working on some magic that will completely avoid this question. And no, don't ask - it would be like opening your presents before xmas.

Graeme
 
Ah thanks guys. :)

Glenn, I figured we could target XYZ but I also figured, as you mention, that just because I target that space doesn't mean that I have accurate data. Part of the question then, I suppose, is how wide can you go and still be accurate? Tough question to answer of course.

Thanks for the info on rec709. Without looking at the gamut in 3D it certainly looked like they use the same chromaticity coordinates but I couldn't think of a way to validate this easily. Good to know! And of course, I am definitely aware of the fact that HD is Y'CrCb, 8bit and the limitations this imposes. So technically it would be pretty easy to use a high color accuracy LCD panel for HD color correction?

Graeme:

Thanks for the info man. Very useful. Good to know that the compression doesn't cause problems with the debayer process!

I do indeed realize that RAW doesn't have a gamut. As I mentioned above, I guess the question really is how accurate are the RGB filter responses to those of the human eye? If they were perfectly in alignment with our visual system we would of course get a perfect full spectrum human color response. If not, the issue that could arise is the camera responding as if two colors are metameric when the human eye would not (not a huge issue). And of course, since no software works in XYZ, nor is any display technology capable of producing full spectrum color* I guess this is all pointless anyway and simply serves to assuage my curiosity.

* Actually have you seen the report a while back about guys creating a display style screen via eltrically controlled diffraction gratings to produce any color the eye can see? Pretty sweet! I need one of those! The only downside would be the need for a perfect light source... but hey!
 
Part of the question then, I suppose, is how wide can you go and still be accurate? Tough question to answer of course.
I don't think you really lose or gain any accuracy when targeting a bigger gamut.

What could happen is that if you target XYZ color space, you get some colors that are outside that gamut / you have values outside 0-100% range. This would happen in exceeding rare occaisions... i.e. prisms, diffraction gratings (i.e. CD), maybe lasers and in low glare situations. This is probably not a pragmatic concern, since I don't know of any display that can produce such a huge gamut.

As I mentioned above, I guess the question really is how accurate are the RGB filter responses to those of the human eye? If they were perfectly in alignment with our visual system we would of course get a perfect full spectrum human color response.

The ideal filters would have responses similar to the CIE CMFs (color matching functions), but adjusted for the target color space (i.e. you apply a matrix to convert from XYZ to Rec.709 or whatever; you would apply that same matrix to the CIE CMFs). In one of the channels, you get a negative response if you're targeting Rec. 709. Sony's RGB+E sensor design solves this my using four color filters. One of the filters handles the negative lobes; digital manipulation turns that response into a negative response, so you can get the required negative lobe.

Poynton's book has some diagrams which might help make sense of things.

2- Because the camera's spectral responses for the color filters don't match the CIE CMFs, you get some color inaccuracy there. This is somewhat of a problem for multicamera situations, although people tweak the cameras' color matrices to get close.
Some people prefer one camera's color reproduction over another (i.e. Varicam over F900).

3- The CIE CMFs are also an average of 17 standard observers. There is slight metamerism between different people (and people with glasses). The (1931) CIE data is also from 1931, at a time where they couldn't produce pure wavelengths (AFAIK). Most literature and theory is based of the 1931 CIE data though. I believe this is because it works fairly well (especially when you consider that we aren't that sensitive to color inaccuracies; there are many color inaccuracies in everyday life).
 
re: the diffraction grating display
The only downside would be the need for a perfect light source

Theoretically, I don't believe you would need a "perfect" light source? Tungsten sources would give you a continuous spectrum, although you don't even need a continuous spectrum. Different sets of spectra would create the same color response in our eyes.
 
As usual, great info. Thanks Glenn. Definitely looks like I need to get my hands on Poynton's book.

As an aside, I recently ran across this:

All broadcast standards in the world are based on ITU-Rec.709 color gamut. The NTSC gamut has been officially dead for more than 25 years.
Unofficially it has even never been used, because the CRTs with the
"correct" phosphors have never been sold to the public. So what the US
have been receiving has always been optimized for CRTs with EBU-like
phosphors. If you were to build a TV with a display that has NTSC
primaries then you will be seeing seriously wrong colors !

That does not mean that you can't make nice pictures on a display with
NTSC primaries, on the contrary. It just takes a lot more effort to
make the natural colors look correct again. Been there, done that.

> and the HD gamut is wider than NTSC.

Not true either. All broadcast gamuts are Rec.709, and what was once
the HD gamut (SMPTE-240 IIRC ?) was very close to Rec.709 anyway.
That is definitely a smaller gamut than NTSC, area wise.
What IS different between SD and HD is the coefficients of the Luma
function, which are taken from Rec.601 and Rec.709 respectively.
But that has absolutely no effect on the gamut, it only defines how
to convert R'G'B'->Y'CbCr->R'G'B'. This should be transparent. [FONT=verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif]
Do you guys know if this is indeed valid? Link to the original source:

http://www.freelists.org/archives/opendtv/08-2006/msg00078.html
 
Theoretically, I don't believe you would need a "perfect" light source? Tungsten sources would give you a continuous spectrum, although you don't even need a continuous spectrum. Different sets of spectra would create the same color response in our eyes.

I'm not entirely sure about this issue. With chromatic adapation I presume? I know there are issues with metamerism when viewing objects under different lighting. Two objects might look the same under tungsten but not under daylight etc. I would image this would might be an issue here too? Though this is a different process since it's a diffraction grating....
 
All broadcast standards in the world are based on ITU-Rec.709 color gamut. The NTSC gamut has been officially dead for more than 25 years.
The main standards are:
SD NTSC - the standard chromaticities are SMPTE C. (There is probably a specific standard name, but I forget it.)
SD PAL - the standard chromaticities are EBU. (There is probably a specific standard name, but I forget it.)
HD- Rec. 709

The original NTSC standard also defined monitor chromaticities. They are now obselete. It defined a very wide gamut. AdobeRGB happens to use the same numbers, likely due to a misconception. According to Charles Poynton, he was the one who pointed out Adobe's error, which is why they changed their RGB working space's name from "SMPTE" (or SMPTE C) into "Adobe RGB". This was abandoned since manufacturers wanted to make their monitors brighter; this is easier if the gamut is smaller. Technology then wasn't as good either, so monitors were much darker back then.

The SMPTE C standard was the chromaticities of the monitors made by Conrac. Those monitors were the most popular reference-grade monitors at the time.

The EBU standard was derived from phosphor technology at that time. Manufacturers mess around with the phosphors to make the image brighter and such. A smaller gamut tends to allow a brighter image.

The Rec. 709 standard was a political compromise. The Red and Blue are the same as EBU. The green is a compromise between SMPTE C and EBU. sRGB adopted Rec. 709 afterwards I believe (?).

There was some interim 1035i HD format- I can't remember what phosphor chromaticities it defined. Anyways, I wouldn't care about that format because you probably don't want to use it (although I see it crop up from time to time).

2- Differences between HD and SD:
a- SD uses different standard chromaticities... SMPTE C and EBU being the most widely used.
HD uses Rec. 709.

b- The transfer functions are different.

c- The luma co-efficients are different. Explanation with pictures:
http://glennchan.info/articles/technical/rec709rec601/rec709rec601.html

In practice, c is the only concern worth worrying about. You need a matrix to specifically convert component video between 601 and 709 luma co-efficients. A (common) cost-saving measure is to omit this matrix.
 
The diffraction grating display:
1- I think I sort of spoke too quickly.

You do need a somewhat continuous spectrum light source.

Suppose you had a light source that only had 3 wavelengths. What you want are 3 colors that match the CIE XYZ primaries.

The CIE XYZ primaries work (fairly well) because our eyes have three different types of cones responsible for color. An ideal color would stimulate only one of those types, and not the other two.

For a 3-wavelength system to achieve that, the colors for X Y and Z would actually require negative light. Because practical monitors can't actually make negative light, you really need more than 3 wavelengths. (See figure 22.4 in poynton's book.)
Few light sources actually produce only ~3 wavelengths; most practical light sources have a continuous SPD (although some have spike SPDs).

2- Metamerism in this case isn't too much of an issue?

i.e. A fluorescent light source (which has a spiky spectral power distribution) of D65 color will appear the same as a black body radiator of D65 color (or a tungsten light filtered to D65).
All those light sources have different spectral power distributions (SPDs). However, assuming all human viewer's responses match the CIE CMFs, all those lights produce the same response in the viewer.

*Ok, so not all human viewer's vision match the CIE CMFs. One of the SMPTE engineering committees (Advanced Imaging Subcommittee) is looking into this currently. A system with 70 primary colors (instead of just 3) would get rid of this metamerism problem, although you can guess that such a system is not pragmatic at all. So they are looking into how much this matters and potential ways of fixing this.

A practical diffraction grating display (for typical home or theatre use) would most likely be fed with a 3-color/primary system. In that case, you still get some metamerism in the viewer (compared to a 70-primary system that captures 70 primaries in shooting). If the diffracting grating display's light source has an uneven SPD, that could increase the metamerism. In practice however, I still don't think it would matter much.

3- Did what I typed make sense??
 
Last edited:
Ok, I did know about the different luma coefficients but had no idea that the old standard was the equivalent of Adobe RGB! That makes a ton of sense now that I think about it.

The one thing I am not sure about still is whether SD and HD use the same chromaticity coordinates (just different luma coefficients). If so that would be news to me! This passage suggests as much and I'm not sure I believe it:

> and the HD gamut is wider than NTSC.

Not true either. All broadcast gamuts are Rec.709, and what was once
the HD gamut (SMPTE-240 IIRC ?) was very close to Rec.709 anyway.

I also find it interesting that this same set of coordinates are identical to the sRGB colorspace... very interesting 'coincidence'?

Re Diffraction Grating:

It's too late - my brain hurts. :D I'll have to sit down and ponder this some more in the morning!
 
SD and HD do use different color gamuts / primary chromaticities.

SD:
SMPTE C gamut
EBU gamut
(obsolete) original NTSC gamut.

HD:
Rec. 709
The 1035i format I can't remember.

2- AdobeRGB used the original (and obsolete) NTSC gamut out of a misconception/mistake according to Poynton.

3- "All broadcast gamuts are Rec. 709" - this is only true for HD broadcast. SD broadcast is still either SMPTE C or EBU. I'm not sure about SECAM. Some countries like Japan use NTSC color encoding, but EBU color gamut.

4- sRGB's use of Rec. 709 chromaticities is intentional. There would be better compatibility between the video and computing world.
 
Back
Top