Pages: 1 ... 7 8 [9] 10   Go Down

Author Topic: This is why no RAW on the G7  (Read 87041 times)

jani

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 1624
    • Øyet
This is why no RAW on the G7
« Reply #160 on: December 15, 2006, 06:49:42 pm »

Quote
Well, while this "critical" debate has raged I've been having fun with my G7.  Let me know the outcome so I'll know whether to hate or love it.
Hah, that's nothing, today I was having fun with my SE K750i.



(Yup, the images are crap, and I didn't even care.)


But I do like your image!
« Last Edit: December 15, 2006, 06:50:35 pm by jani »
Logged
Jan

bjanes

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 3387
This is why no RAW on the G7
« Reply #161 on: December 17, 2006, 03:47:30 pm »

Quote
Actually, WB is very easy in any gamma, as long as the entire DR of the format uses the *same* gamma.  The problem with JPEGs is the compression artifacts, and the fact that the gamma is different in different parts of the tonal range (S-curves and such).  When the gamma is consistent, multiplying any two values by the same amount will result in the same number of stops difference.  Any r:g:b ratio results in the same hue and saturation level at all luminances.
[a href=\"index.php?act=findpost&pid=90623\"][{POST_SNAPBACK}][/a]

As I pointed out earlier, one performs white balance in a linear raw file by multiplying the red and blue channels by a multiplier. In the case of a Nikon D200, the red and blue multipliers are 1.28 and 2.29 respectively for balance at 3200K.

As an example, let's do some WB with various raw RGB values expressed in terms of a bit depth of 8 as shown in the table using these multipliers and then converting to a simplified gamma 2.2 space. We then determine the multiplier necessary to achieve WB from the converted gamma 2.2 values by taking the ratio of the gamma 2.2 to gamma 1.0 values for the given RGB values. As can be seen, the ratios are not constant and the raw multipliers can not be used. WB is not so easy as you claim  

To use a constant multiplier, one would have to convert the gamma 2.2 RGB values back to gamma 1.0 and then multiply. It is often stated that WB can not be done with a gamma 2.2 space, but this is not true as shown by Lightroom and now ACR 4.0.

[attachment=1389:attachment]
« Last Edit: December 17, 2006, 03:57:19 pm by bjanes »
Logged

PeterLange

  • Guest
This is why no RAW on the G7
« Reply #162 on: December 17, 2006, 05:25:24 pm »

Bill,

John is right. For example:

rgb_encoded = (rgb_linear)^(1/2.2)
wherein rgb = RGB / 255 for 8 bit

Let’s apply some linear scaling on the linear data:
rgb_new_encoded = (rgb_linear x multiplier)^(1/2.2)
rgb_new_encoded = multiplier^(1/2.2) x (rgb_linear)^(1/2.2)
rgb_new_encoded = new multiplier x (rgb_linear)^(1/2.2)
wherein the new multiplier = multiplier^(1/2.2)
rgb_new_encoded = new multiplier x rgb_encoded

The multiplier can be extracted from the exponential term to be a new multiplier again.  This can be generalized to be valid on a per channel basis. White balance can be done via linear scaling before or after conversion to a (regular) gamma encoded space.  Even, there is such kind of commutative law in place between linear scaling and matrix-to-matrix conversions in general (including different gamma and primaries).

However, that doesn’t work any more with ready processed JPG’s which were most likely treated with a brightening S-curve, saturation enhancements and all kinds of 3D color-selective tweaks during in-camera conversion.  In this case, conversion back to a linear space helps nothing. Best you can do for white balance is to leave linear scaling and to use R/G/B curves (as recently agreed during another thread).

Cheers! Peter

--
Logged

bjanes

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 3387
This is why no RAW on the G7
« Reply #163 on: December 17, 2006, 06:17:31 pm »

Quote
Bill,

John is right. For example:

rgb_encoded = (rgb_linear)^(1/2.2)
wherein rgb = RGB / 255 for 8 bit

Let’s apply some linear scaling on the linear data:
rgb_new_encoded = (rgb_linear x multiplier)^(1/2.2)
rgb_new_encoded = multiplier^(1/2.2) x (rgb_linear)^(1/2.2)
rgb_new_encoded = new multiplier x (rgb_linear)^(1/2.2)
wherein the new multiplier = multiplier^(1/2.2)
rgb_new_encoded = new multiplier x rgb_encoded

The multiplier can be extracted from the exponential term to be a new multiplier again.  This can be generalized to be valid on a per channel basis. White balance can be done via linear scaling before or after conversion to a (regular) gamma encoded space.  Even, there is such kind of commutative law in place between linear scaling and matrix-to-matrix conversions in general (including different gamma and primaries).

However, that doesn’t work any more with ready processed JPG’s which were most likely treated with a brightening S-curve, saturation enhancements and all kinds of 3D color-selective tweaks during in-camera conversion.  In this case, conversion back to a linear space helps nothing. Best you can do for white balance is to leave linear scaling and to use R/G/B curves (as recently agreed during another thread).

Cheers! Peter

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

Peter,

John is usually right when I disagree with him. When I get time I will go over my table again and see where my calculations went wrong, or perhaps you see the fallacy in them.

Thanks,

Bill
Logged

Ray

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 10365
This is why no RAW on the G7
« Reply #164 on: December 17, 2006, 08:14:52 pm »

When I tried fixing the WB of Jonathan's jpeg containing a color chart, first upsampling to 16 bit in PS, the WB looked approximately the same as in the RAW image, but the greys were not as neutral.

It really boils down to just how accurate do you need to be. Whilst it may be obvious to some that greys in a color chart are not exactly neutral, most scenes do not contain color charts. Over all balance and credibility are more important than total accuracy.

The essential problem in fixing a WB that's noticeably out, is finding something in the scene that's supposed to be a neutral grey, is it not?

The image on the left is Jonathan's jpeg, white balanced in PS in 16 bit mode using 'levels', then reconverted to 8 bit jpeg. The image on the right is the original jpeg from the RAW.

[attachment=1391:attachment]   [attachment=1392:attachment]
Logged

bjanes

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 3387
This is why no RAW on the G7
« Reply #165 on: December 17, 2006, 10:40:15 pm »

Quote
When I tried fixing the WB of Jonathan's jpeg containing a color chart, first upsampling to 16 bit in PS, the WB looked approximately the same as in the RAW image, but the greys were not as neutral.

It really boils down to just how accurate do you need to be. Whilst it may be obvious to some that greys in a color chart are not exactly neutral, most scenes do not contain color charts. Over all balance and credibility are more important than total accuracy.

The essential problem in fixing a WB that's noticeably out, is finding something in the scene that's supposed to be a neutral grey, is it not?

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

Yes, a neutral gray is helpful, but many color balancing algorithms use memory colors such as foliage, blue sky, and human skin. If these are not reasonably natural, the picture will not look good to most people. In many situations accurate color is less important than pleasing color.

Bill
Logged

Stephen Best

  • Guest
This is why no RAW on the G7
« Reply #166 on: December 17, 2006, 10:49:31 pm »

Quote
The image on the left is Jonathan's jpeg, white balanced in PS in 16 bit mode using 'levels', then reconverted to 8 bit jpeg. The image on the right is the original jpeg from the RAW.
[attachment=1391:attachment]   [attachment=1392:attachment]
[a href=\"index.php?act=findpost&pid=91061\"][{POST_SNAPBACK}][/a]

I took the first one, neutralized it properly and here's the result:

[attachment=1394:attachment]

Here's the adjustments to the blue curve:

[attachment=1395:attachment]

The points on the curve come from Shift-Command clicking on each of the grays, and aligning the blue value with the others. All that was left was to fix the highlight/shadow points with a separate Curves adjustment layer (composite channel in Luminosity mode), then a slight saturation boost with Hues/Saturation (in Color mode). Took less than a minute. How'd I do?
Logged

Jonathan Wienke

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 5829
    • http://visual-vacations.com/
This is why no RAW on the G7
« Reply #167 on: December 18, 2006, 03:05:11 am »

I did a click white balance on the second-lightest neutral patch and a quick curve tweak in ACR to get the black point and overall tonality where I wanted it, then applied those settings to all of the shots at once before converting.

You accomplished more or less the same thing by opening the JPEG and creating 2 separate adjustment layers, which will have to be manually applied to each image in the series. I'm pretty sure batch conversion in ACR is faster than opening each JPEG and adding the adjustment layers.
Logged

Stephen Best

  • Guest
This is why no RAW on the G7
« Reply #168 on: December 18, 2006, 04:31:25 am »

Quote
You accomplished more or less the same thing by opening the JPEG and creating 2 separate adjustment layers, which will have to be manually applied to each image in the series. I'm pretty sure batch conversion in ACR is faster than opening each JPEG and adding the adjustment layers.
[a href=\"index.php?act=findpost&pid=91113\"][{POST_SNAPBACK}][/a]

Except that my result is more neutral than yours. Check the gray patches. If you want the same level of neutrality, you'd still have to do something similar. ACR doesn't do a particularly good job of rendering accurate colours overall, certainly not good enough for repro work. Post processing will always be required for optimal results.

Anyway, the point of all this is that it's possible to get pretty good results from JPEG irrespective of the white balance at capture. I went from a file that already had one round of adjustments and did all this in 8-bit ... and didn't spend too much time on it.
Logged

Ray

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 10365
This is why no RAW on the G7
« Reply #169 on: December 18, 2006, 06:34:06 am »

Quote
How'd I do?
[a href=\"index.php?act=findpost&pid=91083\"][{POST_SNAPBACK}][/a]

Stephen,
You did pretty well. Your adjustment is closer to the RAW adjustment than mine. I see there's no need for you to demand RAW mode with a P&S camera   .

I had another look at my WB adjustment. The histogram has spare space at each end. I removed that and also clicked on 'autocolor'. The result is below. What do you think?

I think it's worth mentioning that the RGB values on the 'info pallette' jump around a lot as you move the eyedropper around the surface of any of the grey squares, particularly the darker squares.

There's an impresssion here that's there's variation at the machine level which might not be relevant at the human perception level.

[attachment=1399:attachment]
Logged

Stephen Best

  • Guest
This is why no RAW on the G7
« Reply #170 on: December 18, 2006, 06:56:51 am »

Quote
I had another look at my WB adjustment. The histogram has spare space at each end. I removed that and also clicked on 'autocolor'. The result is below. What do you think?
[a href=\"index.php?act=findpost&pid=91136\"][{POST_SNAPBACK}][/a]

Looks pretty good! I don't know for sure what the original stonework in the background looked like but I find it hard to imagine that it was as greenish as Jonathan's conversion from RAW.  So there's curves work either way to get it looking its best.

I realized after I posted the above that my eyedropper was set to 1x1 so my gray patches aren't as neutral as they could/should be. I'm still transitioning to CS3 and finding things I've missed.
Logged

Jonathan Wienke

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 5829
    • http://visual-vacations.com/
This is why no RAW on the G7
« Reply #171 on: December 18, 2006, 08:03:24 am »

Quote
Except that my result is more neutral than yours. Check the gray patches.

If I do a 6-pixel blur on my image, the variation is pretty small. The lightest 2 patches are within 1 level, the third is within 2 levels, the fourth is within 4 levels, and the darkest two are within 2-3 levels. That's roughly consistent with the deviation from neutral in a theoretically-perfect Color Checker, see Bruce Lindbloom's page of Color Checker RGB values for different color spaces for more detailed info. Bottom line, hand tweaking the curves to achieve perfect channel equality is not going to get you perfect neutrality, and the sensor noise level is greater than the deviations we're talking about anyhow.

My converted RAW is pretty close, on a perceptual level and a nitpicking technical level. The greatest source of error by far is the level of sensor noise.
« Last Edit: December 18, 2006, 08:07:44 am by Jonathan Wienke »
Logged

John Sheehy

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 838
This is why no RAW on the G7
« Reply #172 on: December 18, 2006, 08:43:13 am »

Quote
When I get time I will go over my table again and see where my calculations went wrong, or perhaps you see the fallacy in them.[a href=\"index.php?act=findpost&pid=91044\"][{POST_SNAPBACK}][/a]

Your gamma adjusted values for the "RGB G 2.2" columns are wrong.  The correct values are obtained with g=255*(linear/255)^(1/2.2).

Then, you calculated the ratio of the wrong things.  You need to calculate the ratios of the two sets of linear values, after both gamma adjusted with the above formula.  Then, the ratios will be consistent for all sets.

BTW, your red and blue multipliers, if they are supposed to be from a real camera, are probably swapped.
Logged

John Sheehy

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 838
This is why no RAW on the G7
« Reply #173 on: December 18, 2006, 08:48:21 am »

Quote
Yes, a neutral gray is helpful, but many color balancing algorithms use memory colors such as foliage, blue sky, and human skin. If these are not reasonably natural, the picture will not look good to most people. In many situations accurate color is less important than pleasing color.[a href=\"index.php?act=findpost&pid=91079\"][{POST_SNAPBACK}][/a]

WB is only the beginning of color correction in a RAW converter.  WB only gets whites white and greys grey.  Blues are made blue, red are boosted in saturation, etc, in a separate process, which is not accomplished by scaling color channels.
Logged

Ray

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 10365
This is why no RAW on the G7
« Reply #174 on: December 18, 2006, 09:10:16 am »

Quote
My converted RAW is pretty close, on a perceptual level and a nitpicking technical level. The greatest source of error by far is the level of sensor noise.
[a href=\"index.php?act=findpost&pid=91144\"][{POST_SNAPBACK}][/a]

Jonathan,
That might well be the case. There might well be significant error, in a machine sense, due to sensor noise. But it would not necessarily be apparent in a general scene.

Below are direct comparisons bewtween my twice adjusted jpeg and your your original RAW.

The differences are subtle. I could argue that the 3rd grey from black is slightly darker. The deepest blue and second deepest blue is slightly darker. The cyan square, 3rd from top left is slightly darker and the magenta square, 3rd from top second left is slightly more saturated.

These can all be adjusted according to your skills in PS.

No major problem here and no major reason for RAW mode in limited P&S cameras.

[attachment=1400:attachment]   [attachment=1401:attachment]

MY image is on the left.
« Last Edit: December 18, 2006, 09:12:48 am by Ray »
Logged

Stephen Best

  • Guest
This is why no RAW on the G7
« Reply #175 on: December 18, 2006, 09:35:20 am »

Quote
MY image is on the left.
[a href=\"index.php?act=findpost&pid=91155\"][{POST_SNAPBACK}][/a]

Ray, this time I went back to the original JPEG and re-applied the previous procedure and mine is pretty damn close to yours! I'll leave it to others to decide which of these (the corrected JPEG or original RAW conversion) is a better match to the ColorChecker chart on Bruce Lindbloom's site ... and also subjectively more accurate.

[attachment=1403:attachment]
« Last Edit: December 18, 2006, 09:42:15 am by Stephen Best »
Logged

bjanes

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 3387
This is why no RAW on the G7
« Reply #176 on: December 18, 2006, 10:00:07 am »

Quote
Your gamma adjusted values for the "RGB G 2.2" columns are wrong.  The correct values are obtained with g=255*(linear/255)^(1/2.2).
[{POST_SNAPBACK}][/a]

No, the RGB G2.2 column is correct. It is calculated from the RGB linear value after the raw value is multiplied by the WB coefficient [=(WB Raw * multiplier/255)^(1/2.2)*255]. It represents the white balanced G 2.2 RGB values from the raw file.

I have expanded my original table with the calculations suggested by Peter Lange. G 2.2 No WB represents the gamma 2.2 conversion of the raw file with no WB. The new multiplier is shown along with the WB G 2.2. As you can see the white balanced figures are the same, as Peter predicted.

[attachment=1404:attachment]

Quote
BTW, your red and blue multipliers, if they are supposed to be from a real camera, are probably swapped.
[a href=\"index.php?act=findpost&pid=91150\"][{POST_SNAPBACK}][/a]

No, the multipliers are correct for a Nikon D200 with exposure at 3200K
 
[a href=\"http://www.pochtar.com/NikonWhiteBalanceCoeffs.htm]http://www.pochtar.com/NikonWhiteBalanceCoeffs.htm[/url]

This exercise was a learning experience for me and it demonstrates that the oft stated quote that WB can not be done with a gamma corrected image is not true, as is demonstrated by the various corrections that have been posted in this thread. However, if a tone curve has been applied, then one would have to add another curve to essentially undo the effects of the original. If one is working with a JPEG with a bit depth of 8, data loss with all the manipulations could be significant.
« Last Edit: December 18, 2006, 10:16:41 am by bjanes »
Logged

Kenneth Sky

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 463
    • http://
This is why no RAW on the G7
« Reply #177 on: December 18, 2006, 10:52:08 am »

Does CS 3's ability to handle JPEGs in camera raw alter this discussion? Did Canon know this feature was going to be released? I suspect that altering a JPEG in ACR isn't as good as starting with a RAW file but it may satisfy a lot of the criticism of the G7.
Logged

bjanes

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 3387
This is why no RAW on the G7
« Reply #178 on: December 18, 2006, 11:22:08 am »

Quote
Does CS 3's ability to handle JPEGs in camera raw alter this discussion? Did Canon know this feature was going to be released? I suspect that altering a JPEG in ACR isn't as good as starting with a RAW file but it may satisfy a lot of the criticism of the G7.
[a href=\"index.php?act=findpost&pid=91184\"][{POST_SNAPBACK}][/a]

Since Lightroom already had this ability in its develop module, I do not think that the situation would be dramatically altered by the new capabilities of ACR. When one is limited to 8 bits and the sRGB colorspace, significant post-processing may not be advisable. If you prefer the wider gamut of ProPhotoRGB, you are out of luck.
Logged

John Sheehy

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 838
This is why no RAW on the G7
« Reply #179 on: December 18, 2006, 02:43:09 pm »

Quote
No, the RGB G2.2 column is correct.

Yes, they look correct now.  I must have accidently typed 225 instead of 255 in my spreadsheet earlier.

Quote
No, the multipliers are correct for a Nikon D200 with exposure at 3200K[a href=\"index.php?act=findpost&pid=91176\"][{POST_SNAPBACK}][/a]


I thought it was a daylight value; that's why it looked strange to me..
Logged
Pages: 1 ... 7 8 [9] 10   Go Up