Dynamic range of an image

Discussion in 'Digital Photography' started by Roger N. Clark (change username to rnclark), Aug 15, 2004.

  1. In another thread in this newsgroup, the dynamic range
    of an image and DSLRs are being discussed. In case you
    are interested, I put together a page showsing some results,
    and were not following that thread, see below.

    Here is a page I put together regarding dynamic range.
    I went out in the backyard and snapped a few pictures of
    a pretty random scene and found it had a dynamic range of
    11 bits, and than includes all diffusely reflecting objects
    (no bright metal reflections, no bright clouds in the scene).

    http://clarkvision.com/imagedetail/dynamicrange

    The canon 10D recorded 11 bits of dynamic range
    (max signal / RMS noise near the minimum intensity levels).

    Roger
    Roger N. Clark (change username to rnclark), Aug 15, 2004
    #1
    1. Advertising

  2. "Roger N. Clark (change username to rnclark)" <> wrote
    in news::

    > Here is a page I put together regarding dynamic range.
    > I went out in the backyard and snapped a few pictures of
    > a pretty random scene and found it had a dynamic range of
    > 11 bits, and than includes all diffusely reflecting objects
    > (no bright metal reflections, no bright clouds in the scene).
    >
    > http://clarkvision.com/imagedetail/dynamicrange
    >
    > The canon 10D recorded 11 bits of dynamic range
    > (max signal / RMS noise near the minimum intensity levels).
    >
    >


    Hi Clark - interesting page!

    I am not sure you can meassure the dynamic range thus though.
    The lens may decrease the contrast and therefore increase
    the range that can be recorded. What do you think?


    /Roland
    Roland Karlsson, Aug 15, 2004
    #2
    1. Advertising

  3. Roger N. Clark (change username to rnclark) wrote:
    []
    > http://clarkvision.com/imagedetail/dynamicrange
    >

    []
    > Roger


    Roger, many thanks for that. In another thread, someone gave details
    suggesting a 165:1 range for a black to white image with more even
    illumination.

    Can you explain one thing, please: in the phrase: "the highlights are have
    a max value of 27,580 DN (55160 in ImagesPlus 16-bit unsigned integer)"
    what do you mean by "DN". To me, a 16-bit integer is either 55160 or it
    is not. Where does the 27,580 number come from, and what is it supposed
    to mean?

    Thanks,
    David
    David J Taylor, Aug 15, 2004
    #3
  4. the JPG format offers a dynamic range of 8 bit (values of 0 ... 255) per
    channel. if you define a B/W picture as r+b+g the total dynamic is 0..765.,
    a bit more than 9 Bit.

    AFAIK, the D10 RAW format gives you 3*12 Bit. I suppose that is what the
    camera electronic does.

    if you convert a -say- 8 bit b/w format file to 16 bit the value range will
    change from 0...255 to 0...65563. But the dynamic will not be increased, as
    the correct definition of the dynamic would be "(max value - min value)
    / (second min value - min value)" of a picture (best with using
    _relevant_ values not including those introduced by noise or conversion
    errors.

    -Michael
    Michael Schnell, Aug 15, 2004
    #4
  5. Michael Schnell <> wrote in
    news:cfnad0$a8n$01$-online.com:

    > the JPG format offers a dynamic range of 8 bit (values of 0 ... 255)
    > per channel. if you define a B/W picture as r+b+g the total dynamic is
    > 0..765., a bit more than 9 Bit.


    Nope. The JPEG pictures are stored using gamma based compression.
    So - it is actually more.



    /Roland
    Roland Karlsson, Aug 15, 2004
    #5
  6. David J Taylor wrote:

    > Can you explain one thing, please: in the phrase: "the highlights are have
    > a max value of 27,580 DN (55160 in ImagesPlus 16-bit unsigned integer)"
    > what do you mean by "DN". To me, a 16-bit integer is either 55160 or it
    > is not. Where does the 27,580 number come from, and what is it supposed
    > to mean?


    DN is "Data Number." That is the number in the file for each
    pixel. I'm quoting the luminance level (although red, green
    and blue are almost the same in the cases I cited).

    16-bit signed integer: -32765 to +32765

    16-bit unsigned integer: 0 to 67535

    Photoshop uses signed integers, but the 16-bit tiff is
    unsigned integer (correctly read by ImagesPlus).

    Roger
    Roger N. Clark (change username to rnclark), Aug 15, 2004
    #6
  7. Michael Schnell wrote:

    > the JPG format offers a dynamic range of 8 bit (values of 0 ... 255) per
    > channel. if you define a B/W picture as r+b+g the total dynamic is 0..765.,
    > a bit more than 9 Bit.


    No, dynamic range and bit range are two different things. Dynamic
    range is scene intensity range, minimum to maximum. How many bits
    you use is irrelevant to dynamic range if the transfer function
    is not linear, which it is not in jpegs. I determined the dynamic
    range of the scene by using the raw data extracted in a linear
    format so data number (DN) is linearly proportional to scene
    intensity (number of photons). The sensor is linear in its
    response to light.
    >
    > AFAIK, the D10 RAW format gives you 3*12 Bit. I suppose that is what the
    > camera electronic does.


    Adding the bits from 3 channels does not change the bit range
    of the data, nor the dynamic (intensity) range. Simply adding
    the bits from the 3 channels says nothing about the intensity
    bit range, nor the data bit range.
    >
    > if you convert a -say- 8 bit b/w format file to 16 bit the value range will
    > change from 0...255 to 0...65563. But the dynamic will not be increased, as
    > the correct definition of the dynamic would be "(max value - min value)
    > / (second min value - min value)" of a picture (best with using
    > _relevant_ values not including those introduced by noise or conversion
    > errors.


    No, dynamic range is defined as maximum intensity / minimum intensity,
    where intensity is scene radiance. For a sensor, like in a
    digital camera, the minimum is usually limited by noise.
    Roger N. Clark (change username to rnclark), Aug 15, 2004
    #7
  8. "Roger N. Clark (change username to rnclark)" <>
    wrote:

    [snip]
    >> AFAIK, the D10 RAW format gives you 3*12 Bit. I suppose that is what the
    >> camera electronic does.

    >
    >Adding the bits from 3 channels does not change the bit range
    >of the data, nor the dynamic (intensity) range. Simply adding
    >the bits from the 3 channels says nothing about the intensity
    >bit range, nor the data bit range.


    Further more each pixel is only in one channel in raw. Remember the
    Bayer filter.

    Peter
    Peter Rongsted, Aug 15, 2004
    #8
  9. Roger N. Clark (change username to rnclark)

    Guest

    In message <>,
    "Roger N. Clark (change username to rnclark)" <>
    wrote:

    >DN is "Data Number." That is the number in the file for each
    >pixel. I'm quoting the luminance level (although red, green
    >and blue are almost the same in the cases I cited).
    >
    >16-bit signed integer: -32765 to +32765
    >
    >16-bit unsigned integer: 0 to 67535
    >
    >Photoshop uses signed integers, but the 16-bit tiff is
    >unsigned integer (correctly read by ImagesPlus).


    How do you know that photoshop isn't using unsigned integers, but just
    not using the most significant bit? I could see more use for the
    headroom in intermediate calculations than negative values.
    --

    <>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
    John P Sheehy <>
    ><<> <>>< <>>< ><<> <>>< ><<> ><<> <>><
    , Aug 15, 2004
    #9
  10. Roger N. Clark (change username to rnclark)

    Guest

    In message <>,
    Peter Rongsted <> wrote:

    >Further more each pixel is only in one channel in raw. Remember the
    >Bayer filter.


    I have ways here of looking at the image as 4 quadrants, each with a
    1.58MP greyscale image from each r, G, G2, or B element of each RGGB
    tile. In other words, the red channel in one quadrant, the blue channel
    in another quadrant, and two green channel quadrants. They are all
    aliased, of course. If you combine them into one 1.58MP image, it looks
    horrible if there is any high-contrast sharpness in the image, with
    glaring color fringes around all the edges (this is how George Preddy
    claims all Bayer images start out, before being scaled up to 4x as many
    pixels).
    --

    <>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
    John P Sheehy <>
    ><<> <>>< <>>< ><<> <>>< ><<> ><<> <>><
    , Aug 15, 2004
    #10
  11. wrote:

    > In message <>,
    > "Roger N. Clark (change username to rnclark)" <>
    > wrote:
    >
    >
    >>DN is "Data Number." That is the number in the file for each
    >>pixel. I'm quoting the luminance level (although red, green
    >>and blue are almost the same in the cases I cited).
    >>
    >>16-bit signed integer: -32765 to +32765
    >>
    >>16-bit unsigned integer: 0 to 67535
    >>
    >>Photoshop uses signed integers, but the 16-bit tiff is
    >>unsigned integer (correctly read by ImagesPlus).

    >
    >
    > How do you know that photoshop isn't using unsigned integers, but just
    > not using the most significant bit? I could see more use for the
    > headroom in intermediate calculations than negative values.


    Because all DNs in photoshop ar 1/2 those from ImagesPlus.
    Photoshop maxes out at 32765 and ImagesPLus 65535 (note
    correction to above, not 67535). If you
    just ignore the top bit, half the image would be saturated
    in photoshop. Photoshop had to divide all the
    DNs by 2.

    On octal dump of the tif files show values up in the 65,000 range,
    so the original file is 16-bit unsigned integers.

    Roger
    Roger N. Clark (change username to rnclark), Aug 15, 2004
    #11
  12. Roger N. Clark (change username to rnclark)

    Guest

    In message <>,
    "Roger N. Clark (change username to rnclark)" <>
    wrote:

    > wrote:


    >> How do you know that photoshop isn't using unsigned integers, but just
    >> not using the most significant bit? I could see more use for the
    >> headroom in intermediate calculations than negative values.


    >Because all DNs in photoshop ar 1/2 those from ImagesPlus.


    I know that. And half of what they load in as in Mathcad as well.
    That was taken for granted in my response. My question was in contrast
    to you "unsigned" theory, which also relies on the same assumption
    (halved values).

    >Photoshop maxes out at 32765


    32,767, to be exact.

    >and ImagesPLus 65535 (note
    >correction to above, not 67535). If you
    >just ignore the top bit, half the image would be saturated
    >in photoshop. Photoshop had to divide all the
    >DNs by 2.


    Which is the same thing as shifting the bits to the right, and putting
    the leftmost (MSB) as an unused range.

    >On octal dump of the tif files show values up in the 65,000 range,
    >so the original file is 16-bit unsigned integers.


    The 15 least significant bits for 16-bit signed and unsigned are exactly
    the same for #s 0 through 32767. The only difference is that the MSB
    adds more positive numbers in unsigned (32768 to 65535), and signals
    negative numbers (-32768 to -1) in signed.

    My question was, why do you think that the numbers are unsigned?
    --

    <>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
    John P Sheehy <>
    ><<> <>>< <>>< ><<> <>>< ><<> ><<> <>><
    , Aug 15, 2004
    #12
  13. wrote:

    > In message <>,
    > "Roger N. Clark (change username to rnclark)" <>
    > wrote:
    >
    >
    >> wrote:

    >
    >
    >>>How do you know that photoshop isn't using unsigned integers, but just
    >>>not using the most significant bit? I could see more use for the
    >>>headroom in intermediate calculations than negative values.

    >
    >
    >>Because all DNs in photoshop ar 1/2 those from ImagesPlus.

    >
    >
    > I know that. And half of what they load in as in Mathcad as well.
    > That was taken for granted in my response. My question was in contrast
    > to you "unsigned" theory, which also relies on the same assumption
    > (halved values).
    >
    >
    >>Photoshop maxes out at 32765

    >
    >
    > 32,767, to be exact.

    oops, yes. My fingers don't seem to be typing the right keys
    this weekend!
    >
    >
    >>and ImagesPLus 65535 (note
    >>correction to above, not 67535). If you
    >>just ignore the top bit, half the image would be saturated
    >>in photoshop. Photoshop had to divide all the
    >>DNs by 2.

    >
    >
    > Which is the same thing as shifting the bits to the right, and putting
    > the leftmost (MSB) as an unused range.


    Yes. Aren't we saying the same thing?
    >
    >
    >>On octal dump of the tif files show values up in the 65,000 range,
    >>so the original file is 16-bit unsigned integers.

    >
    >
    > The 15 least significant bits for 16-bit signed and unsigned are exactly
    > the same for #s 0 through 32767. The only difference is that the MSB
    > adds more positive numbers in unsigned (32768 to 65535), and signals
    > negative numbers (-32768 to -1) in signed.
    >
    > My question was, why do you think that the numbers are unsigned?


    Octal dumps of the tif file shows they are unsigned integers.

    Roger
    Roger N. Clark (change username to rnclark), Aug 15, 2004
    #13
  14. Roger N. Clark (change username to rnclark) wrote:

    > In another thread in this newsgroup, the dynamic range
    > of an image and DSLRs are being discussed. In case you
    > are interested, I put together a page showsing some results,
    > and were not following that thread, see below.
    >
    > Here is a page I put together regarding dynamic range.
    > I went out in the backyard and snapped a few pictures of
    > a pretty random scene and found it had a dynamic range of
    > 11 bits, and than includes all diffusely reflecting objects
    > (no bright metal reflections, no bright clouds in the scene).
    >
    > http://clarkvision.com/imagedetail/dynamicrange
    >
    > The canon 10D recorded 11 bits of dynamic range
    > (max signal / RMS noise near the minimum intensity levels).


    I've added another figure:

    Figure 5. Jpeg image values plotted against 16-bit linear
    image values shows the jpeg transfer function (the default contrast on the 10D).
    Note that the jpeg saturates at about half the level of the
    16-bit data. The 16-bit file has a 1 stop increase in dynamic range before
    data saturation compared to the jpeg image.

    The jpeg image has less dynamic range recorded (the lows and highs are
    clipped), and less signal to noise. While the low end of the
    jpeg is close to linear, the Jpeg has only 50 integer levels while the
    16-bit tif image has about 1880 integer levels over the same intensity
    range, or about 37 times finer intensity detail. Toward the bright
    end, the 16-bit tiff image has even more detail than the low end of
    the jpeg image. For example, in the jpeg data from DN 337 to 247,
    the 16-bit image goes from 22800 to 25200 or 2400 DN. Thus the 16-bit
    tiff imge has 2400/10 = 240 times the intensity detail!
    Roger N. Clark (change username to rnclark), Aug 15, 2004
    #14
  15. "Roger N. Clark (change username to rnclark)" <> wrote
    in news::

    > I've added another figure:
    >
    > Figure 5. Jpeg image values plotted against 16-bit linear
    > image values shows the jpeg transfer function (the default contrast on
    > the 10D).
    >


    Nice!

    It shows that you lose a little more than one stop in the bright part.

    The first image (converted from RAW) - is that taken at 1/4000 s?


    /Roland
    Roland Karlsson, Aug 15, 2004
    #15
  16. Roger N. Clark (change username to rnclark) wrote:
    []
    > I've added another figure:
    >
    > Figure 5. Jpeg image values plotted against 16-bit linear
    > image values shows the jpeg transfer function (the default contrast
    > on the 10D). Note that the jpeg saturates at about half the level of
    > the 16-bit data. The 16-bit file has a 1 stop increase in dynamic
    > range before data saturation compared to the jpeg image.


    An excellent addition. As the transfer characteristic is suspected to be
    a gamma correction, would a log-log plot be more appropriate?

    Cheers,
    David
    David J Taylor, Aug 15, 2004
    #16
  17. Roger N. Clark (change username to rnclark)

    Guest

    In message <>,
    "Roger N. Clark (change username to rnclark)" <>
    wrote:

    > wrote:


    >> My question was, why do you think that the numbers are unsigned?


    >Octal dumps of the tif file shows they are unsigned integers.


    My fingers (and brain) are going awry as well. I actually meant to ask
    why you thought that they were signed, in photoshop. I switched
    "signed" and "unsigned" in my head and fingers at some point, so you
    thought I was talking about the initial 16-bit TIFFs. The switch is
    probably do to the fact that "un-" and "negative" are somewhat related.

    So, my actual question (if my brain and fingers cooperate) is, why do
    you think that PS is treating the data as signed?
    --

    <>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
    John P Sheehy <>
    ><<> <>>< <>>< ><<> <>>< ><<> ><<> <>><
    , Aug 15, 2004
    #17
  18. Roger N. Clark (change username to rnclark)

    Guest

    In message <>,
    "Roger N. Clark (change username to rnclark)" <>
    wrote:

    >Wouldn't that be the easiest to program?
    >You've got signed and unsigned int's in C. It would
    >be harder to do unsigned and clip everything and scale
    >it to 32K--just more work and processor time.


    0 to 32767 are exactly the same in 16-bit signed and unsigned, are they
    not? I would think that the choice would depend on what calculation you
    would want to do with the data after it is loaded.

    This is the way I remember it:


    d e c i m a l
    16-bit binary unsigned signed

    0000 0000 0000 0000 0 0
    0000 0000 0000 0001 1 1
    0111 1111 1111 1111 32767 32767
    1000 0000 0000 0000 32768 -32768
    1111 1111 1111 1111 65535 -1


    M L
    S S
    B B


    --

    <>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
    John P Sheehy <>
    ><<> <>>< <>>< ><<> <>>< ><<> ><<> <>><
    , Aug 16, 2004
    #18
  19. wrote:

    > In message <Xns9546DC51665Dklotjohan@130.133.1.4>,
    > Roland Karlsson <> wrote:
    >
    >
    >>It shows that you lose a little more than one stop in the bright part.

    >
    >
    > It varies with the channel. Red is the least sensitive; green is about
    > 144% as sensitive as red, and blue is 184% as sensitive. This explains
    > why highly-saturated blue flowers blow out so easily, even in RAW mode.
    > Red flowers are more likely to blow out in JPEG mode, where the red
    > channel data is severely clipped with daylight white balance.
    >
    > In another thread, I quoted some approximate values which were a bit
    > off, based on memory. At one time, it seemed to me that blue and green
    > were very close, but blue is actually 127% as sensitive as the green
    > channel, in my latest calcultions. Also, I thought I remembered
    > blackpoints as low as 100 out of 4095, but upon looking at actual files,
    > I don't see much below 500. So, there are really never more than about
    > 3600 levels of useful data in any of the channels. With high-ISO, long
    > exposures, the minimal DC component of noise (blackpoint) can be over
    > 1000, reducing the number of useful levels to about 3000.


    In the test image on that started this thread,
    http://clarkvision.com/imagedetail/dynamicrange

    DN levels range from lots of zeros, lots of single digit
    pixels, lots of teens and twenties. RMS noise is in the range
    12 to 16, max levels are 55160 (the 1/2000 second exposure on the
    10D). That is a range of about 12 to over 55,000.

    Roger
    Roger N. Clark (change username to rnclark), Aug 16, 2004
    #19
  20. Roger N. Clark (change username to rnclark)

    Guest

    "Roger N. Clark (change username to rnclark)" <> wrote:
    > Roger N. Clark (change username to rnclark) wrote:


    >> In another thread in this newsgroup, the dynamic range
    >> of an image and DSLRs are being discussed. In case you
    >> are interested, I put together a page showsing some results,
    >> and were not following that thread, see below.
    >>
    >> Here is a page I put together regarding dynamic range.
    >> I went out in the backyard and snapped a few pictures of
    >> a pretty random scene and found it had a dynamic range of
    >> 11 bits, and than includes all diffusely reflecting objects
    >> (no bright metal reflections, no bright clouds in the scene).
    >>
    >> http://clarkvision.com/imagedetail/dynamicrange
    >>
    >> The canon 10D recorded 11 bits of dynamic range
    >> (max signal / RMS noise near the minimum intensity levels).


    > I've added another figure:


    > Figure 5. Jpeg image values plotted against 16-bit linear
    > image values shows the jpeg transfer function (the default contrast on the 10D).
    > Note that the jpeg saturates at about half the level of the
    > 16-bit data. The 16-bit file has a 1 stop increase in dynamic range before
    > data saturation compared to the jpeg image.


    This is fascinating, and rather appalling! The JPEG format has plenty
    of dynamic range to capture everything without saturating, but the
    encoders doesn't do so, instead raming up to saturation very quickly.
    I suppose the idea is to give a more visually appealing image "out of
    the box", but at some cost. I wonder if the JPEG encoders in all
    digital cameras do the same.

    Andrew.
    , Aug 16, 2004
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. c
    Replies:
    2
    Views:
    800
  2. Hans-Peter Walter
    Replies:
    3
    Views:
    1,133
    Joe Bloggs
    Jan 21, 2004
  3. Mr.Adams

    dynamic range of digital image sensors

    Mr.Adams, Apr 5, 2005, in forum: Digital Photography
    Replies:
    10
    Views:
    410
    Alfred Molon
    Apr 5, 2005
  4. Robert Feinman

    Scene range vs dynamic range

    Robert Feinman, Jun 30, 2005, in forum: Digital Photography
    Replies:
    2
    Views:
    664
    Marvin
    Jul 4, 2005
  5. Summer Wind

    High Dynamic Range Image Programs

    Summer Wind, Oct 14, 2007, in forum: Digital Photography
    Replies:
    12
    Views:
    568
    Alfred Molon
    Oct 18, 2007
Loading...

Share This Page