Saturday, June 21, 2008

14-bit capture; does it do anything?

There is lots of confusion on the web about the benefits of 14-bit RAW capture. on the one hand people test it to hardly make any difference shooting test charts, on the other hand it is claimed that far more detail can be extracted from a 14-bit capture. One of the issues is that most of these tests use test charts or highly contrived circumstances, never a real situation. Therefore I decided to give you a real image. This is our garage in a very sunny day (it was Flag day when I shot this as you can see). I used default conversion in Lightroom of this 14-bit shot. In this sort of lighting, in order to not blow out the flag, you end up underexposing the garage. If you're smart in such a situation you might use strobes to light the inside of the garage. Another person would increase the "shadow fill" in Lightroom. Without those tricks, you cannot see the plethora of bikes and the fact that I really need to clean it out, which is perhaps a good thing.

The often repeated "truth" is that supposedly, with 14-bit capture, you get better detail in the shadows as you have the extra bits to play with. To test this, here are two details from the above guide image pushed 4 stops in Lightroom at 100%. I had to set the blacks to zero, otherwise the area stayed simply black. Guess which one is the 14 bits one!

Well? I'll tell you. The first one was shot at 14-bit. Surpsingly for an image pushed a full 4 stops, apart from being slightly brighter (even though the shutter and aperture are the same 1/500 at f5.6 and ISO 100) they are identical. You might even say that the 14-bit one has slightly less detail, but that is likely due to the slightly brighter appearance which makes the contrast and therefore apparent sharpness lower. To check whether this was due to maybe Lightroom not using the full 14-bits, I tried the same thing in Capture NX with the same result. Clearly, in real situations, using a Nikon D300, it is very doubtful that you will see any benefit from shooting at 14 bits. Not having tested other cameras with 14 bit capture such as the Canon 40D, I cannot tell you with certainty that this translates, but I would very highly doubt that you could see a significant benefit there. The reason of course is that the noise in the shadows is already large enough to be in the bottom bits in a 12-bit capture, so the only thing that happens is that you're imaging the noise with higher precision - not very useful and probably a waste of card space.

Tuesday, June 17, 2008

Firefox 3.0 released

Today, to great fanfare (and an embarrassing server crash) Firefox 3.0 got released. This is a great and fast browser even if on the Mac I prefer Safari. One of the promises it held was that finally, there would be a mainstream browser outside Safari that supports color management. Unfortunately, it is not enabled by default which is a very bad decision. There is no good reason for this and the quoted reasons (incorrect color in pages that mix CSS elements and images) is just plain wrong technically. Color managed apps will only color manage images that have a profile. Image elements on webpages never have those, so the appearance will not change. Luckily, there is an option to enable color management in Firefox that is hidden in the secret configuration pages. You enable it by typing "about:config" in the address bar (without quotes). Click "I'll be careful" and you'll get a page with many obscure settings. In the Filter box, type "management" and the only two relevant options will come up. Make sure that display_profile is set to the default, and double click on the"enabled" property to change its value into "true." This will turn on color management and will make those images on the web that have profiles embedded appear as they were meant (as long as you have calibrated your monitor). Even images in sRGB will benefit from this. This really should be the default and I think it is a major error that they did not enable this at least as a visible preference. Next time better I hope.

To learn why this is really important, see this excellent explanation. Test your color managed browser here.

Edit: it turns out that Firefox 3.0 color manages every image, even untagged ones. That is a superb choice!

Sunday, June 15, 2008

What does 12 MP buy you over 6MP?

After a few months in repair, my D50 finally came back working perfectly. This allowed me to compare the two cameras. One thing I noted is that the exposure meter is far more intelligent in the D300 than it is in the D50. The latter regularly underexposes by a full stop if you let it do what it wants. Another thing is resolution. Since the D50 is 6 MP and the D300 is 12 MP you would expect a considerable increase in resolution. It is a question how significant this is of course as the linear resolution increase is only √2. So I shot a few realistic images with sharp lenses using a tripod in the same location and same lighting and same exposure.

Here is the overview:

At this scale there is no difference whatsoever between the cameras when using Lightroom to develop the RAW except a small difference in color, so I didn't bother to put both up. Below is a detail. Left = D50, right = D300. Both are using default capture sharpening in Lightroom. Both can benefit about equally from some finetuning of the capture sharpening but it doesn't impact the comparison really.

And here is the D50 image scaled up to match the D300 image:

I did all cropping and scaling in Photoshop to avoid the very annoying bug in Lightroom that causes halos around strong contrast edges that even shows up when all you do is just cropping. The bottom line is far more detail in the D300 image and this is the cheap kit lens that came with the D50. Of course the image you see is a detail of a blowup of 42"x28" (I assume your screen is 100 ppi) for the D300 case and 30"x20" for the D50 case. When printed at something like 8x12, you will not see any difference between the cameras, except perhaps with a magnifying glass. These differences are smaller than you'd think at normal print sizes. Also, technique is far more important than sensor resolution in general. No sensor is going to save you from motion blur, unsteady hands, or incorrect focus. Most lenses, even cheap ones, are plenty sharp when used correctly. All a camera like the D300 does is focus faster and more consistent, expose better, and in general get out of your way more. I love my D50 for how light and simple it is and if you do not need the better framerate or better focusing, something like a D40 will work fine for you.

Saturday, June 14, 2008

Leica M8

There were two reviews of the Leica M8, a digital rangefinder camera modeled after the famous film Leicas that recently made the rounds on the web. I never saw the point of the digital version and thought it is just an expensive toy for collectors. For that price Leica should really manage to put a full-frame sensor in there, it would add almost nothing to their cost compared to what they're asking and make the camera infinitely more useful, but I digress. I saw two recent reviews posted by two different photojournalists recently that reach diametrically opposed conclusions. They're interesting reads. The first and very negative one is from Michael Kamber. He rides around with troops in Iraq and finds the M8 utterly lacking for many of the reasons one would expect. The second is from Bruno Stevens, who ascribes almost mythical qualities to the M8. While the first review is sometimes silly in its putdowns (images that have moderate noise but still good definition are completely unusable suddenly, while they are better than what you get with fast film), it is very well supported and is exactly in line with what you expect from the camera. On the other hand the second review makes conclusions that are untenable such as that the M8 has similar quality to a 6x9 scan which is just impossible for a crop sensor no matter how good the lens but he makes a good point that the unobtrusiveness of a rangefinder is great in certain situations. Of course you get the same effect with a $200 P&S. I thought that the juxtaposition of the two reviews was very interesting and really illustrates that people can have very different and often valid viewpoints of the same thing.

Update: I just read this fantastic column that is very applicable to the Leica thing.

Sunday, June 8, 2008

ISO noise quantified

Warning: geek content!

In my previous post, I looked at noise in bokeh areas on my D300. You can clearly see some noise at ISO200 in darker out-of-focus areas on that camera. At the end I showed that the noise is quantified in the jpeg filesize. Being the science geek that I am, I did a quick analysis on it. Here is the filesize plotted vs the ISO rating:

The red curve shows a fit to a simple square-root dependence on ISO. This is not just some arbitrary choice. If the noise is coming from simply photon-counting statistics, you expect approximately a square root dependence of the signal-to-noise ratio on exposure time. In this case, this means that the absolute noise should also scale with the square root of the ISO rating. Indeed, you can see, barring an offset of 129 KB owing to the fileheaders and the actual scene information, there is a square-root dependence of the filesize on the ISO speed. Interestingly, since the jpeg encode is a visual compression scheme, this should correlate with how visible the noise is as you could clearly see in my previous post. Also, at ISO 100, the amount of noise is indeed almost negligible as you can see from the negligible difference in size between the ISO 100 jpeg (144 KB) and the limit at (the impossible) ISO 0 of 129 KB.

Now there are some issues here that I have not addressed. 1. Lightroom might be doing more noise reduction at higher ISOs than it is at low ISOs, and 2: Jpeg filesize does not linearly correspond to the amount of noise. This is a toughie!
So you should just take this for what it is, despite appearances, rather unscientific! I do find it intriguing however, that the metric clearly seems to scale with visible noise and that the metric seems to indicate simple statistical noise, meaning that the amplifiers in the camera do not seem to introduce much noise at this light level.

Noise in bokeh areas on the Nikon D300

I usually shoot my Nikon D300 at ISO 200 (the default). However, in certain circumstances, I have noticed noise in darker out-of-focus areas (i.e. in the bokeh). You can completely remove it in Lightroom by just dialing in a luminance noise reduction of 5. However, this prompted me to check out the noise as a function of ISO in a realistic image using default RAW conversion in Lightroom instead of some silly test chart. The NEF was shot at 14-bits and using only lossless compression. I used a 50mm f1.8 lens at f2.8. Here is the awesome scene I shot:

Here is a 100% crop at ISO 100

ISO 200:

Clearly there is far more noise in the bokeh. There is very little chance you will ever see that in a print and as I said, you can take care of it easily with just a tiny bit of luminance noise reduction, but it might be good to be aware of it.

Now for completeness:

ISO 400:

ISO 800:

ISO 1600:

This is where I reached the maximum shutter speed on the D300 (1/8000 s), so I cannot show you any more. The D300 does very well even at ISO 6400 as I reported before. At the low ISOs, Capture really doesn't do much better than Lightroom in noise reduction for those who are curious to know. However at high ISOs (>800), Capture does far better.

Interestingly, if you look at the filesizes of the jpeg exports I made from the 100% crops at high quality, you can see the exact same trend. Jpeg size, due to the way the compression operates, correlates with noise as the agorithm cannot distinguish between noise and real information. Here is the list:

ISO Size (KB)
100 148
200 160
400 172
800 188
1600 212

Since the scene and lighting was exactly the same in each image, the only thing that is different is the amount of noise in the image. Amazing that the effect is that clear.

Next: Analysis of the filesize in terms of noise

sRGB tone curve and the Lightroom color space

I got to thinking about the display of color values and the histogram in Lightroom. Lightroom internally uses a working space with prophotoRGB primaries but with linear gamma. Using linear gamma avoids all kinds of possible artefacts and is a good choice if you have the bitprecision. On the display of RGB values in percentages and the histogram, to avoid all values to be in the 0-1% range, Lightroom modifies the values with a sRGB tone curve. I was curious to see what this really means. In this original proposal by the group from HP and Microsoft that originally designed sRGB this is explained more or less. sRGB does not have a simple 2.2 gamma that you can use but a complex curve that has a knee in the shadows. The equations are as follows:

If you have a linear R,G, or B value in sRGB primaries, the equation to find the value in nonlinear sRGB space are:

if R ≤ 0.00304,
Rnl = 12.92* R

if R>0.00304,
Rnl = 1.055* R1/2.4-0.055

repeated for Green and Blue of course.
So, save for the multiplication with 100 to get percentages, Lightroom uses this exact math to calculate the percentage values in linear prophotoRGB to the sRGB tonecurve modified prophotoRGB value display space (I'll call that the Lightroom Value Space or LVS). This tonecurve looks like the following on a double-log plot.

In Red the sRGB tonecurve and in Blue the curve for a simple 2.2 gamma. You can see that for values below 0.05 in the linear space, the deviation from a 2.2 gamma is larger than 5%. Conversely, in the non-linear LVS space, values below 10% are significantly different from when you would assume a 2.2 gamma. This means that the values I published before for the values for the MacBeth colorchecker color patches in the LVS system are all wrong. Here are the correct values:

Sorry for the graphic, I still haven't figured out how to make tables appear correctly in blogger. You can clearly see that the values are significantly different. Hope this is useful for somebody!

Saturday, June 7, 2008

Another Gold hill sunrise

An image from March that I had not worked up before

This is a composite of 8 hand-held shots done at sunrise from a hut in the mountains south of Aspen. For some reason I had missed this series. I have another earlier version of a different series of shots composited similarly. The colors are very different even if the time difference between the shots is pretty minor. This is a good illustration of how important timing is in photography.