Pages: 1 2 3 [4] 5 6 ... 14   Go Down

Author Topic: Does a raw file have a color space?  (Read 190213 times)

Panopeeper

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 1805
Does a raw file have a color space?
« Reply #60 on: January 20, 2008, 12:04:10 am »

Quote
What are the colorants of the actual Bayer filter pattern used to filter the photons coming in to come up with the RGB filtered grayscale densities for each camera?

There is no such thing. It is important to understand, that

a. it is possible to create all or almost all visible colors with the mixing of at least three properly selected, fixed colors (primaries),

b. it is not sufficient to capture only such primary colors with the sensor; the sensor needs to capture *all* wavelengths. Thus the filters are not analogous to the phosphor or to the LED.

In fact, all three "colored" pixels capture the entire or almost the entire visible spectrum, but not all wavelengths equally. Any given wavelength can pass all three filters, but to different degrees in the three kind of filters.

As one would expect it, the red filter lets the light rays in the red range pass through to a higher degree, than other wavelengths (and even the different wavelengths in the red range result in different response). Therefor the three kind of pixels can be seen as the red, green and blue components of an RGB color and this way the original scenery can be reproduced quite well, but it does not come even close to the result of de-mosaicing and color transformation.

I attach two images, one converted by DPP with all neutral settings, the other is with the raw pixels interpreted directly as red, green respectively blue (white balanced on the same spot). Click on the thumbnails to see the larger image (a small crop of a 20D shot).

I added a third rendering: every pixel on the monitor shows only one color component, the one corresponding to the raw pixel's dominant color, the other two components are null. This is much sharper, but darker because of the lack of the two other color components. Furthermore, it is greenish, because half of the pixels are green.
« Last Edit: January 20, 2008, 12:13:23 am by Panopeeper »
Logged
Gabor

Josh-H

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 2079
    • Wild Nature Photo Travel
Does a raw file have a color space?
« Reply #61 on: January 20, 2008, 12:25:55 am »

Quote
There is no such thing. It is important to understand, that

a. it is possible to create all or almost all visible colors with the mixing of at least three properly selected, fixed colors (primaries),

b. it is not sufficient to capture only such primary colors with the sensor; the sensor needs to capture *all* wavelengths. Thus the filters are not analogous to the phosphor or to the LED.

In fact, all three "colored" pixels capture the entire or almost the entire visible spectrum, but not all wavelengths equally. Any given wavelength can pass all three filters, but to different degrees in the three kind of filters.

As one would expect it, the red filter lets the light rays in the red range pass through to a higher degree, than other wavelengths (and even the different wavelengths in the red range result in different response). Therefor the three kind of pixels can be seen as the red, green and blue components of an RGB color and this way the original scenery can be reproduced quite well, but it does not come even close to the result of de-mosaicing and color transformation.

I attach two images, one converted by DPP with all neutral settings, the other is with the raw pixels interpreted directly as red, green respectively blue (white balanced on the same spot). Click on the thumbnails to see the larger image (a small crop of a 20D shot).

I added a third rendering: every pixel on the monitor shows only one color component, the one corresponding to the raw pixel's dominant color, the other two components are null. This is much sharper, but darker because of the lack of the two other color components. Furthermore, it is greenish, because half of the pixels are green.
[a href=\"index.php?act=findpost&pid=168303\"][{POST_SNAPBACK}][/a]

Can you please point out for my benefit in laymans terms what those 3 images are being used to demonstrate? That DPP does a better convsion?

Thanks.
Logged
Wild Nature Photo Travel

Panopeeper

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 1805
Does a raw file have a color space?
« Reply #62 on: January 20, 2008, 01:34:44 am »

There is no need to prove, that DPP does a better conversion, because the other program does not do any (that's not a raw converter).

The second and third images show, that the original image can be reconstracted without a color conversion as well, however the color reproduction based on displaying raw channels as RGB channels is not a substitute for the "proper conversion". I posted these, because tlooknbill was apparently in the belief, that the pixels' filters are analogous to the light emitting sources of a monitor.

Apart from that, these images show, that the "greyscale" theory is unserious. As an addition, here are the images with only red, green or blue, respectively. These show tlooknbill, that the all three "kinds" of pixels are capturing practically the entire scene, but different colors to different degrees. The fourth image shows a selection on the red flower and the pixel statistics over that selection: although the red is dominant, there is much green there and considerable blue as well.
Logged
Gabor

Tim Lookingbill

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 2436
Does a raw file have a color space?
« Reply #63 on: January 20, 2008, 02:03:10 am »

Panopeeper said...

"There is no such thing."

...In reference to Bayer Filter array needed to filter the random collection of photons from any given scene collected in the camera sensor's photosite cavity's or containers, buckets how ever you want to call them.

This site provides a simple explanation suggesting otherwise...

http://www.cambridgeincolour.com/tutorials/sensors.htm

It also says that 2/3 of the information or spectra collected in the scene is discarded. How the heck are you going to derive a color space from a process that throws that much of the full spectra of light away? What colors DO get thrown away? Can this be determined or measured?

I may not have explained it correctly but it still is a fact according to that site that the Bayer RGB primaries are used to filter out that 2/3rd's of light data that gets thrown away. So you can't tell me that the actual appearance/spectral properties of the red, green, blue filters used shouldn't be taken into account as part of the discription of the color space of the camera's sensor. There's just way to many variables in the process to measure from.

I'ld say the color space could be more determined by attaching the same lens used on the camera capturing the scene onto a device that actually measures light and build a profile from that then figure out some way of calculating discarding 2/3rd's of the information.

Looks to me with the dominance of green a table based profile would have to be built with calculations encoded to balance out the green without relying on human intervention in establishing white point color temp. What's the color temp of an overly green image?
Logged

Ray

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 10365
Does a raw file have a color space?
« Reply #64 on: January 20, 2008, 06:29:39 am »

Quote
It also says that 2/3 of the information or spectra collected in the scene is discarded. How the heck are you going to derive a color space from a process that throws that much of the full spectra of light away? What colors DO get thrown away? Can this be determined or measured?
[a href=\"index.php?act=findpost&pid=168314\"][{POST_SNAPBACK}][/a]

Good question! It's not clear to me how much overlapping takes place and how much total light is blocked out by the Bayer filters. Kodak has a patented CFA which includes fewer color filters and more panchromatic filters. If my memory serves, it's 50% panchromatic and 50% R,G, & B, resulting in a S/N improvement of 1-2 stops.

If the improvement is that great by making just half the pixels panchromatic, then the Bayer CFA must be blocking a significant portion of light. Perhaps not 2/3rds, but pretty close.
Logged

John Sheehy

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 838
Does a raw file have a color space?
« Reply #65 on: January 20, 2008, 09:13:14 am »

Quote
The second and third images show, that the original image can be reconstracted without a color conversion as well, however the color reproduction based on displaying raw channels as RGB channels is not a substitute for the "proper conversion". I posted these, because tlooknbill was apparently in the belief, that the pixels' filters are analogous to the light emitting sources of a monitor.
[a href=\"index.php?act=findpost&pid=168310\"][{POST_SNAPBACK}][/a]

They could be, to some degree.  My dark green Yellow Warbler could have been on a monitor with the CFA pattern of the camera, making a 1:1 correspondence; the green pixels could have been weaker, and the red and blue more intense, to make the over-all effect properly white-balanced at a brighter level (I had to cut the intensity of each green in half here), and the image would only be a little bit off from accurate color.  With properly designed filters on an LCD monitor, you could probably get close to displaying a RAW in good daylight WB without altering the intensities at all, if the monitor performed the gamma adjustment on the fly.
Logged

papa v2.0

  • Full Member
  • ***
  • Offline Offline
  • Posts: 206
Does a raw file have a color space?
« Reply #66 on: January 20, 2008, 10:46:45 am »

Quote
So while we could agree its a data file (no arguments there), we still go back to the original writings of Bruce (essentially Grayscale) versus that of others (color data). Which is it?

Even the four color geeks (three true color scientists that do this for a living) seem to either somewhat disagree or use differing language.

Both Eric and Jack are members of the ICC and spend a great deal of time in the various committees (both part of the camera committee) trying to define these kinds of terms. What hope do we have here of coming to some agreement in terms???
[a href=\"index.php?act=findpost&pid=168204\"][{POST_SNAPBACK}][/a]


Well I would say Bruce ( god bless his ) was talking crap!

He was a, photoshop monkey, not a colour scientist.  Colouratti my foot!

RAW file just a data file.

Mr Holm said


"A raw image does have a color space if we allow non-colorimetric values to be called color space values. If we don’t allow this then only colorimetric cameras (of which there are very few) have color spaces.

I think it is easer to allow non-colorimetric color spaces and use “colorimetric color spaces” than to invent a new term for non-colorimetric color spaces. (Actually, about ten years ago I proposed the term “spectral space” in ISO but no one liked it.)

What I think is misleading is to give the impression that non-colorimetric cameras have a well-defined relation to colorimetry. Yes, we can estimate colorimetry well enough for practical purposes but different estimates can produce different results and be equally valid."


Specrtal space is a good term. I would go with Mr Holm on that one.

and this would sum up from Mr Holm

"What I think is misleading is to give the impression that non-colorimetric cameras have a well-defined relation to colorimetry. "


I know this so im out of here.
Logged

Panopeeper

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 1805
Does a raw file have a color space?
« Reply #67 on: January 20, 2008, 11:28:08 am »

Quote
It also says that 2/3 of the information or spectra collected in the scene is discarded. How the heck are you going to derive a color space from a process that throws that much of the full spectra of light away? What colors DO get thrown away? Can this be determined or measured?

I suspect that you misunderstood that site (I have not read it). The filters do filter out a large portion of the light; the proportion depends on the actual filters.

However, they usually don't filter out a range of the visible spectrum, but reduce the intensities depending on the wavelength. If all three filters filter out some visible wavelength completely, then that is lost - and the camera sucks.

Look at the attached graphs of several cameras; they show, in what sense this "2/3 of the spectrum" is meant, namely one filter filters this part more, another that part.

Quote
So you can't tell me that the actual appearance/spectral properties of the red, green, blue filters used shouldn't be taken into account as part of the discription of the color space of the camera's sensor. There's just way to many variables in the process to measure from

Funny, that you are saying this. Not only that I have not stated that the spectral responses can be ignored, but I posted earlier in the thread:

Look at the spectral responses of the three channels of different cameras and see, how different these responses are. Do you believe, that these can be described with only nine parameters?

Do you prefer phantom discussions?
« Last Edit: January 20, 2008, 11:33:29 am by Panopeeper »
Logged
Gabor

Peter_DL

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 544
Does a raw file have a color space?
« Reply #68 on: January 20, 2008, 01:12:11 pm »

Quote
Look at the spectral responses of the three channels of different cameras and see, how different these responses are. Do you believe, that these can be described with only nine parameters?
[a href=\"index.php?act=findpost&pid=168377\"][{POST_SNAPBACK}][/a]
Rags Gardner ?

Anyway, here’s a comment by Thomas Knoll which I consider to be fundamental in this context. I’ve inserted two words [ ].

“Actually, to create a camera filter set that is "perfect", it is not required to exactly the match the human cone responses (or the XYZ responses). All that is required is the filter responses be some linear combination of the human cone responses. If that is the case, then a simple 3 by 3 matrix [space] can be used in software to recover the exact XYZ values.

If the filter set is not a [perfect] linear combination of the cone responses (which is the case for all current cameras), then any color calibration is going to be some kind of comprise, getting some colors correct and other colors incorrect. This is true even if you know the exact illuminant spectral curve and the exact filter spectral response curves.”

DPL

--
Logged

Panopeeper

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 1805
Does a raw file have a color space?
« Reply #69 on: January 20, 2008, 02:01:10 pm »

Quote
They could be, to some degree.  My dark green Yellow Warbler could have been on a monitor with the CFA pattern of the camera, making a 1:1 correspondence

The question is, if the pixels' filters could be analogous to the light emitting sources of a monitor. This means in the context of that post, that the sensor filters would let only a single wavelength (or a very narrow range of wavelengths) pass through.

Such a sensor could capture only a small fraction of a scenery (I don't believe it is technically feasible to create such sensors).
Logged
Gabor

Panopeeper

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 1805
Does a raw file have a color space?
« Reply #70 on: January 20, 2008, 02:20:28 pm »

Quote
If the filter set is not a [perfect] linear combination of the cone responses (which is the case for all current cameras), then any color calibration is going to be some kind of comprise, getting some colors correct and other colors incorrect. This is true even if you know the exact illuminant spectral curve and the exact filter spectral response curves

I think this is true only in the context of the conversion defined by a 3x3 matrix, like ACR is doing it, otherwise the linearity is not a necessary but sufficient condition. I believe (but I don't claim it) that there can be combinations of non-linearly responding filters yielding unambiguos colors. This is very important, for there are no filters with linear response anyway, i.e. one has to live with the the funny responses.

This does not mean, that all existing sensors are capable of delivering unambiguos results; maybe none of them is. However, I think that this is possible with the careful design of the filters; I admit, that this is based only on my "feeling".
Logged
Gabor

bjanes

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 3387
Does a raw file have a color space?
« Reply #71 on: January 20, 2008, 02:24:00 pm »

Quote
Rags Gardner ?

Anyway, here’s a comment by Thomas Knoll which I consider to be fundamental in this context. I’ve inserted two words [ ].

“Actually, to create a camera filter set that is "perfect", it is not required to exactly the match the human cone responses (or the XYZ responses). All that is required is the filter responses be some linear combination of the human cone responses. If that is the case, then a simple 3 by 3 matrix [space] can be used in software to recover the exact XYZ values.

If the filter set is not a [perfect] linear combination of the cone responses (which is the case for all current cameras), then any color calibration is going to be some kind of comprise, getting some colors correct and other colors incorrect. This is true even if you know the exact illuminant spectral curve and the exact filter spectral response curves.”

DPL

--
[a href=\"index.php?act=findpost&pid=168400\"][{POST_SNAPBACK}][/a]

Peter,

I remember that quote well because I was participating in that thread on the Adobe forum. I could never quite figure out what "linear combination" meant. What is being plotted on the x and y axis to give a linear curve?

Bill
Logged

GregW

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 306
    • http://
Does a raw file have a color space?
« Reply #72 on: January 20, 2008, 03:12:01 pm »

After reading this thread yesterday - Which I freely chose to do -  my feeble intellect was somewhat challenged.  

My initial reaction to rebuke the pointless nature of the post.  I knew I wasn't going to learn something that would have a direct impact on my images.  

On reflection, I've decided to invoke the politicians friend, the U turn.   Ultimately it's fascinating and worthwhile to understand even just a little more about an important subject like color.  It's made all the more worthwhile because there are a number of noteworthy and well informed contributors.  

Feeling guilty for yet again spending time reading rather than doing photography, I sentenced myself to the F6 and a roll of Tri-X and proceeded to enjoy myself in a childlike manner.  Tomorrow, once I've sobered up from the euphoria that is the simplicity of film I'll pass over the F6, pick up the D3 and realize that there really are some great advantages that ultimately offset the complexity of the digital medium.

Despite knowing the inevitable complexity we are going to face, it's good to peek under the hood from time to time.

Thankyou
Logged

eronald

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 6642
    • My gallery on Instagram
Does a raw file have a color space?
« Reply #73 on: January 20, 2008, 03:45:19 pm »

Quote
"If the filter set is not a [perfect] linear combination of the cone responses (which is the case for all current cameras), then any color calibration is going to be some kind of comprise, getting some colors correct and other colors incorrect. This is true even if you know the exact illuminant spectral curve and the exact filter spectral response curves.”
"
Peter,

I remember that quote well because I was participating in that thread on the Adobe forum. I could never quite figure out what "linear combination" meant. What is being plotted on the x and y axis to give a linear curve?

Bill
[{POST_SNAPBACK}][/a]


Actually, the quote above has it backwards, you want the cone responses to be a linear combination of the filters. Which actually occurs if the opposite is true and the transformation is invertible.

The cone responses are how *you* see. The filter responses are how the *camera* sees. You ant to be able to get the values you would see from the values the camera sees.

In this case assume you have a filter set of spectrums (FR,FG,FB), and cone responses (l,m s) as [a href=\"http://blogs.mathworks.com/steve/2006/12/26/colorful-anniversaries/]described here[/url]. Then you want to have a simultaneous set of equations like

l= a*FR+b*FG+c*FB
m=d*FR+e*FG+f*FB
s=g*FR+h*FG+i*FB

which allows you to compute (l,m,s) -how you see- by a simple matrix multiplication (a linear vector operation) from FR, FG, FB.  

Of course (l,,m,s) and (FR,FG,FB) are all spectral responses here, not numbers, so this is in practice never going to happen unless you use multispectral imaging to create FR,FG,FB synthetically (numerically) while using a multispectral camera.

I would strongly recommend that you read a standard colorimetry text and some elementary algebra, we all need a booster shot from time to time.

Edmund
« Last Edit: January 20, 2008, 03:54:02 pm by eronald »
Logged
If you appreciate my blog posts help me by following on https://instagram.com/edmundronald

John Sheehy

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 838
Does a raw file have a color space?
« Reply #74 on: January 20, 2008, 08:56:58 pm »

Quote
Good question! It's not clear to me how much overlapping takes place and how much total light is blocked out by the Bayer filters. Kodak has a patented CFA which includes fewer color filters and more panchromatic filters. If my memory serves, it's 50% panchromatic and 50% R,G, & B, resulting in a S/N improvement of 1-2 stops.

If the improvement is that great by making just half the pixels panchromatic, then the Bayer CFA must be blocking a significant portion of light. Perhaps not 2/3rds, but pretty close.
[a href=\"index.php?act=findpost&pid=168336\"][{POST_SNAPBACK}][/a]

It would be nice to have Raw file from such a camera to see the exact difference, but I think 1 - 2 stops is a bit optimistic.  Remember, these unfiltered pixels can only bring the total QE halfway up to the ideal, as only half of the pixels are idealized.  I can not help but think that this really cripples the image chromatically in some way.
Logged

Ray

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 10365
Does a raw file have a color space?
« Reply #75 on: January 20, 2008, 09:28:29 pm »

Quote
It would be nice to have Raw file from such a camera to see the exact difference, but I think 1 - 2 stops is a bit optimistic.  Remember, these unfiltered pixels can only bring the total QE halfway up to the ideal, as only half of the pixels are idealized.  I can not help but think that this really cripples the image chromatically in some way.
[a href=\"index.php?act=findpost&pid=168480\"][{POST_SNAPBACK}][/a]

Yes, I wondered about that. The maths doesn't seem to fit. Even if the claimed improvement were only one stop maximum, that would imply that the sensor as a whole was receiving double the amount of light with the same exposure.

But I guess the actual amount of light blocked is scene dependent. Less light is blocked when the scene is predominantly green and more when the scene is predominantly red or blue.

On second thoughts, the maths does fit, doesn't it? If half the sensor receives 3x the amount of light due to the removal of the color filters, then the sensor as a whole receives 1.5x the amount of light, ie. a 1.5 stop advantage.

Oops! Correction again. 1.5x the amount of light is not quite 1.5 stops. Maths is not my strong point   .
« Last Edit: January 20, 2008, 09:51:29 pm by Ray »
Logged

John Sheehy

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 838
Does a raw file have a color space?
« Reply #76 on: January 21, 2008, 11:04:23 am »

Quote
Oops! Correction again. 1.5x the amount of light is not quite 1.5 stops. Maths is not my strong point   .
[a href=\"index.php?act=findpost&pid=168486\"][{POST_SNAPBACK}][/a]

1.5x the amount of light is log(1.50)/log(2) = 0.585 stops more light.  The reduction in shot noise, however, is only half of that, or 0.292 stops.  Read noise, relative to absolute exposure is a full 0.585 stops better.
Logged

Ray

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 10365
Does a raw file have a color space?
« Reply #77 on: January 21, 2008, 11:18:31 am »

Quote
1.5x the amount of light is log(1.50)/log(2) = 0.585 stops more light.  The reduction in shot noise, however, is only half of that, or 0.292 stops.  Read noise, relative to absolute exposure is a full 0.585 stops better.
[a href=\"index.php?act=findpost&pid=168574\"][{POST_SNAPBACK}][/a]

So on average we're looking at something around one stop advantage, or slightly less?

This is what can happen when one has too many beers the night before. I know that double the amount of light equals one stop.  
« Last Edit: January 21, 2008, 12:30:36 pm by Ray »
Logged

papa v2.0

  • Full Member
  • ***
  • Offline Offline
  • Posts: 206
Does a raw file have a color space?
« Reply #78 on: January 21, 2008, 12:36:28 pm »

This might be of imterest
Logged

John Sheehy

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 838
Does a raw file have a color space?
« Reply #79 on: January 21, 2008, 01:07:14 pm »

Quote
So on average we're looking at something around one stop advantage, or slightly less?

This is what can happen when one has too many beers the night before. I know that double the amount of light equals one stop. 
[a href=\"index.php?act=findpost&pid=168575\"][{POST_SNAPBACK}][/a]

I don't know exactly what we're looking at, because a combination of things is going on, as the DR of the camera is being expanded (but not of the individual pixels).  I was just commenting on the absolute sensitivity of photosites that collect 1.5x as much light, a figure you provided; that would mean 0.292 stops improvement in shot noise, and 0.585 for read noise, in those clear photosites.
Logged
Pages: 1 2 3 [4] 5 6 ... 14   Go Up