tom_halfhill Posted July 7, 2004 Share Posted July 7, 2004 This posting falls into the FWIW category... I was wondering, what is the natural characteristic curve of a digitalsensor? How does it compare with the characteristic curve of b&w film?With a Nikon D70 at hand, I decided to run a test, similar to thetests I run with b&w film to determine the best exposure index anddevelopment time. With the camera in manual mode and focused at infinity, I photographedan evenly lit white wall at a distance of about two feet, in order toobliterate all detail and get pure tonality. I made a series ofexposures at Zone 0 through Zone IX. For those not versed in the ZoneSystem, my first shot was -5 stops below the metered exposure (Zone0); second shot was -4 stops below the metered exposure (Zone I);third shot was -3 stops below (Zone II); and so on, up to Zone IX,which was +4 stops above the metered exposure. (Metered exposure isalways Zone V.) Next, I opened each picture in an image editor and measured theaverage pixel values at the center of the image. I concentrated on thecenter to eliminate the effects of lens vignetting. By "pixel values,"I mean the brightness levels, 0-255. Finally, I entered all the average pixel values into a spreadsheet andgraphed them against the Zone scale. The result is acharacteristic-curve graph like the ones in film data sheets. Ofcourse, with Photoshop you can alter the curve almost any way you wantafter taking the picture, but this graph is the "natural" unalteredcurve produced by the camera. I did the test three times: ISO 200 in JPEG format (large, fine); ISO1600 in JPEG format (large, fine); and ISO 200 in RAW format. To mysurprise, all three curves are nearly the same, within the tolerancesof my measurements. Another surprise was the very gentle curve in theshadow zones, much like b&w film -- I was expecting a more linearresponse from an electronic sensor. In addition, I noted that Zone VIII always showed an average pixelvalue of 255 (maximum possible brightness), meaning there is notextural detail at Zone VIII, which is why I didn't bother to chartZone IX. Therefore, I conclude that the Nikon D70 has a naturaldynamic range of eight stops maximum, or more like seven stops fordetectable tonality. (Actual printable tonality might be even less,depending on the printer.) That's one or two stops less than ispossible with most b&w films if you're careful about exposure anddevelopment. Below are the three graphs from my spreadsheet. Comments welcome. Ismy methodology sound? Link to comment Share on other sites More sharing options...
tom_halfhill Posted July 7, 2004 Author Share Posted July 7, 2004 And the next one... Link to comment Share on other sites More sharing options...
tom_halfhill Posted July 7, 2004 Author Share Posted July 7, 2004 And the last one... Link to comment Share on other sites More sharing options...
peter_williams2 Posted July 7, 2004 Share Posted July 7, 2004 I'm suprised to see a curve like that. I'd always seen it written that the sensors have a linear response to light levels. Link to comment Share on other sites More sharing options...
tom_halfhill Posted July 7, 2004 Author Share Posted July 7, 2004 Hmmm, one possible problem with my test just occurred to me...don't know why I didn't think of it before. RAW files are 12-bit files, so the pixel range should be 0 to 4,095 instead of 0 to 255. But when I opened the RAW files in Nikon Capture, the information window displayed the pixel values in the range of 0 to 255. Does Nikon Capture automatically convert 12-bit files to 8-bit files when opening them? If so, what would be the point of shooting RAW? Nikon's RAW converter plug-in won't work with my old version of Photoshop (LE 5.0), so I can't open the RAW files any other way. In any case, this only affects the third graph in my test, not the JPEG graphs. Link to comment Share on other sites More sharing options...
leonard_evens Posted July 7, 2004 Share Posted July 7, 2004 There may be a potential problem with your approach. In any given scene, firmware in the camera may expand or contract the range. It may also change the other aspects of the sensor response. With film, it doesn't matter whether you expose the whole film to a specific light level or if you just expose a small portion to that light level. If the development is the same, you will get the same density in the film at any point with that light level. Other densities at different points on the film don't matter. So a characteristic curve plotting density against exposure gives an objective criterion which tells you how a scene will be recorded in densities. In a digital camera, the RGB values in the range 0..255 aren't the same as densities in a characteristic curve because the firmware will be doing the equivalent of varying the development. In short, RGB values should not generally be thought of as densities. At least what I say is relevant for the non-raw modes. I don't know exactly what happens in raw mode, but I suspect there may also be some program manipulation there. Link to comment Share on other sites More sharing options...
._._z Posted July 7, 2004 Share Posted July 7, 2004 CCDs are indeed supposed to have a linear response, beyond which there is immediate falloff. <p> <u><A href = http://www.normankoren.com/Tutorials/MTF7.html> http://www.normankoren.com/Tutorials/MTF7.html</a></u> <p> <u><A href = http://www.imaging-resource.com/PRODS/S20PRO/S20A6.HTM> http://www.imaging-resource.com/PRODS/S20PRO/S20A6.HTM</a></u> Link to comment Share on other sites More sharing options...
tom_halfhill Posted July 7, 2004 Author Share Posted July 7, 2004 Leonard, I considered that. Certainly in the non-RAW modes, there is lots of firmware processing going on: color-space conversion (I set the D70 to Adobe RGB mode), white balance (mine was auto), sharpening level (mine was medium low), contrast level (normal), saturation level (normal), JPEG compression (fine-large), etc. All those things can be changed in the D70's custom settings menus. So, strictly speaking, the JPEG graphs show the characteristic curves for a D70 at those particular settings, not the actual characteristic curve of the image sensor. That's why I repeated the test in RAW format. It should have eliminated all those variables. However, the RAW curve looks the same. Link to comment Share on other sites More sharing options...
todd_west Posted July 7, 2004 Share Posted July 7, 2004 CCD sensors have a linear response. Nikon LBCAST is not a CCD. Even if it was, that doesn't mean the gain of the on die amps is linear. Also, .[. Z isn't citing relevant information. One link is an MTF chart, not a characteristic curve. The other is an ideal line drawn on a graph without any supporting measurement data from real---CCD---device. Tom, congradulations on producing the first estimate of a digital camera's characteristic curves I've ever seen. Nikon capture *should* be doing an intelligent job of mapping 12 bit raw down to 8 bit, so 12 curves *should* look pretty much the same. I'd like to repro this in RGB once I get a D70, but that's likely to be another 6 months or thereabouts, so don't hold your breath. Link to comment Share on other sites More sharing options...
leonard_evens Posted July 7, 2004 Share Posted July 7, 2004 My point is that you might have obtained a different characteristic curve if you went about it differently. For example, you could have arranged a scene with known light intensities at different parts of the field. If you had done that with values going from Zone I to Zone IX, it is possible you would have found Zone IX at 255 and Zone VIII at less than that. Similarly if the range had been from Zone I to Zone VII. I just got my D70 and I'm still learning how to use it. At some point I will try some experiments along those lines myself. Link to comment Share on other sites More sharing options...
._._z Posted July 8, 2004 Share Posted July 8, 2004 <i><blockquote> .[. Z isn't citing relevant information. One link is an MTF chart, not a characteristic curve. The other is an ideal line drawn on a graph </blockquote> </i><p> Actually the relevance is that both are reports from knowledgeable sources which note that CCDs have linear responses. Link to comment Share on other sites More sharing options...
bobatkins Posted July 8, 2004 Share Posted July 8, 2004 It's all gamma converted, whether you use RAW or JPEG. You're measuring the software, not the intrisic response of the sensor. Still useful I guess. Canon RAW conversion software has the option of doing a linear conversion. I'd guess that might give you a curve closer to the intrinsic sensor response, but you don't know for sure. It's not very surprising the curve looks like film. That's what the software does. It makes the sensor data look like film! Link to comment Share on other sites More sharing options...
tom_halfhill Posted July 8, 2004 Author Share Posted July 8, 2004 Leonard, I'm still not sure what you mean. The standard way of doing a Zone test is to fill the frame with a single, evenly lit, evenly toned subject (like a wall or a gray card). Creating a scene with multiple Zones wouldn't make any difference that I can see, because you have to take the picture at a single exposure setting, which means you have to decide which area of tonality to meter and to place on which Zone. So the results would be the same. Of course, you can choose to place any area of tonality on any Zone, just as you can with film. Bob: So the camera's firmware automatically applies a film-like gamma curve to the linear output of the sensors, even in RAW mode? That surprises me. I would expect that in JPEG mode, but not in RAW. I'm wondering if sensors are really as linear as we've been led to believe. Why shouldn't they behave like film? It might take a certain number of photons before a particular light well registers a response, just as it takes a certain number of photons to affect a silver halide grain. The response builds up slowly at first, then becomes linear for the middle part of the curve. When the light well becomes filled with photons, no additional photons will produce a stronger output signal. That would account for the characteristic curves I produced. Other electronic devices behave in a similar way. For example, the transistors in a microprocessor have a threshold voltage that determines when they switch between their "on" and "off" states. Applying a voltage lower than the threshold voltage doesn't switch them. Link to comment Share on other sites More sharing options...
ilkka_nissila Posted July 8, 2004 Share Posted July 8, 2004 The D70 definitely doesn't give a linear response. That's a very good thing because prints made with a linear reproduction chain look terrible. Link to comment Share on other sites More sharing options...
tom_halfhill Posted July 8, 2004 Author Share Posted July 8, 2004 Ilkka, wouldn't a linear curve have more shadow detail? It would be interesting to repeat this experiment with other digital cameras. It requires full manual control over aperture and shutter speed. Link to comment Share on other sites More sharing options...
leonard_evens Posted July 8, 2004 Share Posted July 8, 2004 Tom, Let me try again. With film, the factors invovled are the "sensor" response and the development. With the D70, the factors involved are the sensor response and the firmware program, which can be thought of as analagous, at least in part, to the development. With film, the photographer decides to alter development, and hence the characteristic curve depending on the contrast range in the scene. With the D70, the program does it. Link to comment Share on other sites More sharing options...
._._z Posted July 9, 2004 Share Posted July 9, 2004 For people paying attention, no one said that any DSLR provided a linear response. Rather, it was the CCD which does. Link to comment Share on other sites More sharing options...
tom_halfhill Posted July 9, 2004 Author Share Posted July 9, 2004 I found someone who is way ahead of me on this. It turns out that the D70 (and D100, and probably other DSLRs) *do* apply a tone curve to the raw data from the sensor. Furthermore, with the D70/D100 at least, it's possible to customize the tone curve. In fact, the author of this website provides custom curves for free downloading. I haven't tried that yet, but his explanation makes a lot of sense. Go here: <P> <A HREF="http://fotogenetic.dearingfilm.com/custom_tone_curves.html">Photogenetic website: Nikon DSLR characteristic curves</A> <P> Link to comment Share on other sites More sharing options...
ilkka_nissila Posted July 9, 2004 Share Posted July 9, 2004 Tom, I don't think shadow detail is limited by the number of bits in the data, but by noise in the low bits. I'm assuming that the noise is also compressed by the curve transformation, as well as the shadow signal. So, you can still recover the original data more or less by doing a reverse transformation. (Assuming that you can measure it.) I would much rather have a printable file out of the camera (as is the case with the D70) than spend months or years learning how to adjust the images so that decent prints can be made. I have the gravest difficulties getting natural looking prints from the D100 and I think one of the reasons is in this graph above. I am very grateful to Nikon for making the D70 a very very economical camera. 1) Because it's not expensive, and 2) because it produces excellent prints with minimal adjustment, saving me much frustration and time. Link to comment Share on other sites More sharing options...
._._z Posted July 9, 2004 Share Posted July 9, 2004 and 3) it provides Illka ample opportunity to go around defending the D70 and bashing compeitor products. Link to comment Share on other sites More sharing options...
joseph_wisniewski Posted July 9, 2004 Share Posted July 9, 2004 Todd - First, the D70 does not use a Nikon LBCAST sensor, it uses a Sony CCD. Second, LBCAST, CCD, and CMOS are all linear. Link to comment Share on other sites More sharing options...
joseph_wisniewski Posted July 9, 2004 Share Posted July 9, 2004 Tom, what you have measured is not the characteristic curve of the sensor. All current sensors, weather Canon CMOS, Foveon CMOS, Sony CCD, Fuji CCD, or Nikon LBCAST, are linear devices. The amplifiers that follow them are also linear. Linear processing is necessary for the camera's internal computations, such as noise reduction and white balance correction. It's not "gamma" as has been suggested. What you've measure is a "tone curve". A mapping from the linear response of the sensor to a "pleasant looking" nonlinear curve. It's very similar to a film characteristic curve, as you've seen. It's pretty constant with ISO. Digital cameras allow you to change the shape of the tone curve by selecting different coontrasts. On some cameras, that's exactly what the adjustment is called. On your D70, it's in the "Optimizing Images" section under "tone comp". You can select high contrast "steep" curves, or low contrast "shallow ones". You can also set "auto" tone compensation, in which case, every picture will use a different curve. Unless you've selected a Vari-Program mode, in which case, you get whatever tone curve Nikon has created for that prticular type of subject. In Nikon DSLRs like D70, you can create a custom tone curve via Nikon Capture, and upload it to the camera, to do really wild things. You can make the curve double back on itself, and end up with solarization. Link to comment Share on other sites More sharing options...
tom_halfhill Posted July 12, 2004 Author Share Posted July 12, 2004 I understand. Over the weekend I downloaded a custom tone curve from the Photogenetic web site (which I cited above) and used Nikon Capture to install the curve in my D70. Based on my preliminary shooting, it is definitely an improvement over the camera's default curve. The pictures are a little brighter and need less adjustment in Photoshop to make good prints. There is significantly more shadow detail and midtone detail, and a little better highlight detail. In fact, there is even some tonality at Zone 0 and Zone VIII -- though probably not printable. To confirm what the custom tone curve is doing, I repeated the Zone System test, measured the pixel values in the center of the images, entered the data into Excel, and generated a graph of the new characteristic curve. If you compare this graph with the previous graphs I posted above, you will see a more film-like S-curve. Remember, this is a graph of actual results, not just an illustration of the custom tone curve I installed. (The custom curve is called the "White Wedding" curve by the proprietor of the Photogenetic web site.) Link to comment Share on other sites More sharing options...
todd_west Posted August 30, 2004 Share Posted August 30, 2004 <p>Revisting this thread after a while. Interesting collection of posts. Neat to see Tom's updated curve. A couple follow on comments...</p> <p><i>the D70 does not use a Nikon LBCAST sensor, it uses a Sony CCD</i></p> <p>I don't think there's conclusive evidence either way. I'll agree for the Sony bit, but Nikon's own specs on the avowedly LBCAST D2H refer to it as having "4.1 Effective Megapixel CCD". Unquote. Nikon outsources sensor production, so it's entirely possible wafers out of a Sony fab have LBCAST devices on them. Nothing you couldn't determine with a wafer saw and an electron microscope, but I doubt anyone's going to actually find out.</p> <p><i>LBCAST, CCD, and CMOS are all linear</i></p> <p>To go anywhere with this, a more precise definition of linear is needed. Sure, most semiconductor devices have a well defined operating region which can reasonably be called linear, but bloom is an open and shut case of nonlinear response. If you really want to get fuzzy, any nonlinear system can be linearized about a certain operating point for sufficiently small displacements. It's certainly reasonable to contend some of the characteristic curve is linear operation, but it's going to take more than one sentence to convince me all of it is. It wasn't amping out an R+G site, but in the cases where I've used FET charge pumps, the FETs were emphatically <b>not</b> biased in the triode region.</p> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now