Results 1 to 19 of 19

Thread: I am confused about bit depth 12-bit vs. 14-bit

  1. #1

    Join Date
    Sep 2012
    Location
    Bakersfield, CA
    Posts
    298
    Real Name
    Ed

    I am confused about bit depth 12-bit vs. 14-bit

    My camera allows me to select 12-bit or 14-bit RAW files. 12-bit retains 4,096 somethings per color channel or pixel and 14-bit retains 16,384 somethings per color channel or pixel. It is hard for me to imagine 16,384 bits saved for every pixel, the file size would be enormous...correct? So 16,384 refers to what, exactly?

  2. #2
    Moderator Dave Humphries's Avatar
    Join Date
    May 2008
    Location
    Windsor, Berks, UK
    Posts
    16,040
    Real Name
    Dave Humphries :)

    Re: I am confused about bit depth 12-bit vs. 14-bit

    Quote Originally Posted by Abitconfused View Post
    My camera allows me to select 12-bit or 14-bit RAW files. 12-bit retains 4,096 somethings per color channel or pixel and 14-bit retains 16,384 somethings per color channel or pixel. It is hard for me to imagine 16,384 bits saved for every pixel, the file size would be enormous...correct? So 16,384 refers to what, exactly?
    Hi there,

    I don't know how much you have read here before posting, but you may notice (to keep things really friendly) we much prefer real names to usernames here at CiC, it would be great if you could Edit your profile and add a first name in the Real Name field and a Location in the Location field (just a town/city or state/country is fine)

    To answer your question, the most accruate answer would be gained by shooting the same shot in both RAW modes and see what happens to the file size.

    I would imagine one will be bigger, I suspect it won't be as astronomically different as you fear, but since my camera doesn't offer a choice, I have no experience.

    The bit depth will impact the dynamic range that can be recorded, as you may know.
    For normal subjects and conditions (whatever they are ), 12 bits will be enough, but for some subjects, 14 bits would be preferred; e.g. interiors with windows in shot, etc.

    Welcome to the CiC forums from ...

  3. #3

    Join Date
    Dec 2008
    Location
    New Zealand
    Posts
    17,662
    Real Name
    Have a guess :)

    Re: I am confused about bit depth 12-bit vs. 14-bit

    Quote Originally Posted by Abitconfused View Post
    My camera allows me to select 12-bit or 14-bit RAW files. 12-bit retains 4,096 somethings per color channel or pixel and 14-bit retains 16,384 somethings per color channel or pixel. It is hard for me to imagine 16,384 bits saved for every pixel, the file size would be enormous...correct? So 16,384 refers to what, exactly?
    Not 16384 bits - only 14 bits - but those 14 bits do describe up to 16384 levels.

    In reality it makes a difference - but usually not a big difference. Most cameras capture around 12 stops of dynamic range - so ...

    8192 levels describe the first stop
    4096 the second
    2048 the 3rd
    1024 the 4th
    512 the 5th
    256 the 6th
    128 the 7th
    64 the 8th
    32 the 9th
    16 the 10th
    8 the 11th
    4 the 12th

    Or to put that another way, if you're only using 12 bit recording then devide all of those by 4 ... and you can see that as you get further and further down into the darks then you can end up with very few levels. In reality it's not usually a problem - but - if you under-expose a shot significantly - or have a high dynamic range to capture - and you and up revealing some of those darks then if the bit depth is insufficient then you're probably going to get posterisation occurring.

    Normally there's no penalty to using 14 bit anyway - and if you're using 12 bit and need to use levels in that region then they're probably going to be very noisy anyway.

    So in short, just stick to 14 bit unless there's a good reason to use 12 (and I can't think of one!).

  4. #4
    Moderator GrumpyDiver's Avatar
    Join Date
    Mar 2012
    Location
    Ottawa, Canada
    Posts
    12,337
    Real Name
    Manfred Mueller

    Re: I am confused about bit depth 12-bit vs. 14-bit

    Your camera has been designed to resolve images to 14-bits per channel, i.e. 14 bits of red data, 14 bits of green data and 14 bits of blue data. While the end points, for instance the darkest shade of red and the brightest shade of red are fixed, there are 16,382 discrete variations between these end points. With 12-bit colours, the same logic goes, but there are only 4096 shades that go from the darkest to light variant of those colours.

    If you do the math, using 12-bit rather than 14-bit means you are only going to retain only 1/4 of the colour detail that your camera recorded.

    So the question is why you would care? The answer is the impact of post-processing at the higher the bit depth, reduces the risk of banding or other artifacts from that type of work, at least in theory. I have one 12-bit camera and one 14-bit camera and have never noticed any issues when working in either, so perhaps someone with a different experince than I have might be able to better answer that question . I suspect that problems might only show up in very large print sizes.

    In my case, it is a bit philospophical; data storage is cheap, so why would I throw out data unnecessarily, just in case I might need it later. I use lossless compression to store my 14-bit raw images.

  5. #5
    John Morton's Avatar
    Join Date
    Aug 2012
    Location
    New York NY USA
    Posts
    459

    Re: I am confused about bit depth 12-bit vs. 14-bit

    As you no doubt know, a bit is an "either/or" logical switch - on or off, black or white, and so on.

    After the first either/or, we start getting into levels of grey that extend between black and white - two bit, 2X2, would be black and white with two levels of grey in between - for a total of four levels.

    3 Bit = 2X2X2 (8)
    4 Bit = 2X2X2X2 (16)
    5 Bit = 2X2X2X2X2 (32)

    As you can see, the total level of greys goes up exponentially so it increases quite quickly.

    Programs such as Photoshop are called "grey scale editors" because they actually work with these grey scale levels, rather than colors. Each primary color - Red, Green, and Blue (RGB) has its own grey scale. These three primary colors are combined to produce all the colors that we see on screen but the calculations are done using grey scale data.

    The RGB sensor of a digital camera captures information in grey scale, with a series of color filters over the pixel capture sites being (most commonly) arranged in what is called a Bayer Pattern. Only Red light reaches a pixel capture site through a Red filter; but the information is actually captured as grey scale data (which is assigned a color value for red).

    So if you have a 14 bit color depth, which gives 16,384 grey scale levels per color channel, that gives you somewhere around 4,398,046,511,104 colors. With twelve bit color space, that would be 68,719,476,736 colors - a huge difference.

    Of course, this isn't something you would easily see since the subtle difference between such colors would be indistinguishable to the human eye; but what the human eye can notice is when gradients are not smooth: the curve of a sports car in sunlight, and apple partially shaded, curves of the human form that are partially lit. This is where having more color depth is a bit help; although there are lots of other examples (greens in a rainforest; blues in Caribbean waters, and so on).

    12 bits is apparently of an advantage when speed is of the essence, such as for photographing sports (less information for the camera to process in each shot).

    Where a HUGE difference does come up is when dealing with black and white images, because the range of greys in a 14 bit image is huge compared to what would be available in an 8 bit greyscale image. There, since every color channel must be at the same level as each other, there are only 16,384 levels of grey available; but that is vastly more than the 256 levels available with an 8 bit greyscale.

  6. #6
    herbert's Avatar
    Join Date
    Oct 2010
    Location
    Sussex, UK
    Posts
    471
    Real Name
    Alex

    Re: I am confused about bit depth 12-bit vs. 14-bit

    There are good explanations already in this thread on why 14-bit is better. Note that the step from 12 to 14 bits is adding only 2 extra bits of storage. So the files should be 14/12 or 16.67% bigger (unless the switch makes additional changes such as lossy compression). Not much more considering the advantages for post-processing with the extra colour information.

    This setting does not matter if your are using JPEGs. They will still be 8-bit.

    Alex

  7. #7

    Join Date
    Dec 2008
    Location
    New Zealand
    Posts
    17,662
    Real Name
    Have a guess :)

    Re: I am confused about bit depth 12-bit vs. 14-bit

    Quote Originally Posted by herbert View Post
    Note that the step from 12 to 14 bits is adding only 2 extra bits of storage. So the files should be 14/12 or 16.67% bigger (unless the switch makes additional changes such as lossy compression). Not much more considering the advantages for post-processing with the extra colour information.
    I would have thought that most would use 2 bytes to store either 12 or 14 bits -- so no file size difference?

  8. #8
    benm's Avatar
    Join Date
    Feb 2010
    Location
    New Jersey, USA
    Posts
    315
    Real Name
    Ben

    Re: I am confused about bit depth 12-bit vs. 14-bit

    On some cameras shooting in 12-bit allows significantly faster burst rate than 14-bit (and longer before the buffer fills). Helpful for action, etc. Which setting to use depends on what you are shooting.

  9. #9
    Moderator GrumpyDiver's Avatar
    Join Date
    Mar 2012
    Location
    Ottawa, Canada
    Posts
    12,337
    Real Name
    Manfred Mueller

    Re: I am confused about bit depth 12-bit vs. 14-bit

    Quote Originally Posted by Colin Southern View Post
    I would have thought that most would use 2 bytes to store either 12 or 14 bits -- so no file size difference?
    That would have been my first thought too, Colin, but when I look in my D800 manual it tells me that an uncompressed 12-bit RAW file is 25.0 MB and an uncompressed 14-bit RAW file is 32.5 MB.

  10. #10

    Join Date
    Nov 2009
    Location
    Provence, France
    Posts
    906
    Real Name
    Remco

    Re: I am confused about bit depth 12-bit vs. 14-bit

    Quote Originally Posted by GrumpyDiver View Post
    That would have been my first thought too, Colin, but when I look in my D800 manual it tells me that an uncompressed 12-bit RAW file is 25.0 MB and an uncompressed 14-bit RAW file is 32.5 MB.
    Strange, that's a lot more than a 1/6 increase in size... Otoh, it is easy to pack a 12-bit format in a 16-bit file format (PC standard), 14-bit is a bit more awkward. Looks like the D800 uses a packed format for 12-bit (with 2 pixels packed in 3 bytes), and an unpacked 16-bit padded format for the 14-bit RAW(?). I know, 32.5 is more than 25*4/3, but there's a good chunk of metadata as well in there.

  11. #11

    Join Date
    Dec 2008
    Location
    New Zealand
    Posts
    17,662
    Real Name
    Have a guess :)

    Re: I am confused about bit depth 12-bit vs. 14-bit

    Quote Originally Posted by benm View Post
    On some cameras shooting in 12-bit allows significantly faster burst rate than 14-bit (and longer before the buffer fills). Helpful for action, etc. Which setting to use depends on what you are shooting.
    Hmmm - mine does 12 FPS with 14 bit files (but admittedly, can do up to 14 FPS with JPEGs only)

  12. #12

    Join Date
    Dec 2008
    Location
    New Zealand
    Posts
    17,662
    Real Name
    Have a guess :)

    Re: I am confused about bit depth 12-bit vs. 14-bit

    Quote Originally Posted by revi View Post
    Strange, that's a lot more than a 1/6 increase in size...
    It could be that due to the effective increase in detail that the files aren't as compressible?

  13. #13
    benm's Avatar
    Join Date
    Feb 2010
    Location
    New Jersey, USA
    Posts
    315
    Real Name
    Ben

    Re: I am confused about bit depth 12-bit vs. 14-bit

    Well, on my D300S with 12-bit I can get 7 FPS but with 14-bit I can only get 2.5 FPS

  14. #14
    Moderator GrumpyDiver's Avatar
    Join Date
    Mar 2012
    Location
    Ottawa, Canada
    Posts
    12,337
    Real Name
    Manfred Mueller

    Re: I am confused about bit depth 12-bit vs. 14-bit

    Quote Originally Posted by revi View Post
    Strange, that's a lot more than a 1/6 increase in size... Otoh, it is easy to pack a 12-bit format in a 16-bit file format (PC standard), 14-bit is a bit more awkward. Looks like the D800 uses a packed format for 12-bit (with 2 pixels packed in 3 bytes), and an unpacked 16-bit padded format for the 14-bit RAW(?). I know, 32.5 is more than 25*4/3, but there's a good chunk of metadata as well in there.
    Looking at the math, I find it a bit confusing as well, but I suspect that you are right about how they pack the data. I would have thought that the overhead for the metadata would have been the same for 12 and 14 bit data, so that would mean that the percentage overhead would be higher in 12-bit than in 14-bit. I'm also a bit surprised that they don't just pack the data sequentially, at a bit level and use the offset to decode the actual 12 or 14 bit data strings.

  15. #15
    pnodrog's Avatar
    Join Date
    Sep 2012
    Location
    Waipu, Northand, New Zealand
    Posts
    3,348
    Real Name
    Paul

    Re: I am confused about bit depth 12-bit vs. 14-bit

    I am reasonably sure that RAW data is not saved as RGB but as individual levels for each pixel (12 or 14bit). The colour is determined when processing the RAW file and will be dependent on the Bayer filter and the pixel cells sensitivity to the wave length that the filter allows through. The cells may have the same sensitivity to different wave lengths but I suspect not (certainly not in the early days of sensor design). Bayer arrangement at 12 bits give 48 bits or 6 Bytes and 14 bits give 56 bits or 7 Bytes so the packing is probably not that odd. Provided sensor manufactures stick to using even bit DAC and continue with the current Bayer arrangement the groups will always fall on Byte boundaries.

    In the old days packing data across byte boundaries was out of necessity fairly common due to memory and storage being minute by today's standards. As memory and storage became cheaper programmers tended to optimise for functional performance rather than minimising memory usage. If all data was optimally packed ZIP files would not exist.

  16. #16

    Join Date
    Nov 2009
    Location
    Provence, France
    Posts
    906
    Real Name
    Remco

    Re: I am confused about bit depth 12-bit vs. 14-bit

    Well, just had a (short) look at the dcraw source code, and there's over 20 routines called XXX_load_raw() in there... And the few
    I looked at a bit more don't call one common routine to decode the data. So there are several ways of storing raw data, different
    enough that they need separate routines to be loaded. From the ones I looked at, at least one used a padded format, and some
    used Huffman encoding (a compression system).

    @Colin: yes, the extra detail could play a role, but that much?
    Also, the manufacturer felt he could give precise numbers, not usually the case with compressed formats: the RAWs from
    my Sony A330 can vary in size between 6.8 and 15.2 Mb, so there's some compression going on there.

    @Paul: I agree that memory and storage requirements aren't a big factor nowadays. However, data transport between memory and
    processor is already a bottleneck when treating the data, and transfer to/from storage media is several orders of magnitude worse.
    So that's still a good argument for using compressed/packed formats for RAW data written to memory cards. Several threads here show
    that the transfer is often the slowest step in the process, and the one that limits burst length and speed. See also Colin's comment about
    getting 12 FPS with 14-bit RAW, and 14 FPS with JPEG (which require more processing, and yield smaller files(?))

    Remco
    Last edited by revi; 2nd October 2012 at 07:42 AM.

  17. #17
    pnodrog's Avatar
    Join Date
    Sep 2012
    Location
    Waipu, Northand, New Zealand
    Posts
    3,348
    Real Name
    Paul

    Re: I am confused about bit depth 12-bit vs. 14-bit

    Yep Remco I can compress a RAW file on my camera. I have the option of full RAW or compressed RAW which I guess compounds blocks of almost identical data. There is a warning in my camera manual that it can result in a very slight reduction in quality. The Huffman encoding I understand is lossless however requires additional processing. Back to the performance vs storage trade off.

  18. #18
    Moderator GrumpyDiver's Avatar
    Join Date
    Mar 2012
    Location
    Ottawa, Canada
    Posts
    12,337
    Real Name
    Manfred Mueller

    Re: I am confused about bit depth 12-bit vs. 14-bit

    I have 4 RAW storage modes; both the 12 and 14 bit modes I mentioned in a previous entry, and the manual does mention that 14 bit has better colour data in 14 bit versus 12 bit.

    I can also use compressed lossless (14-bit only) with a file size reduction of 20 - 40% over uncompressed. This is what I use.

    There is also a lossy compressed with a 35 - 55% reduction in file size with a supposeded minor loss in quality, again 14-bit only.

    One of these days when I have time, I'm going to look at the difference in lossy compression versue 12-bit to see how they compare.

  19. #19

    Join Date
    Sep 2012
    Location
    Bakersfield, CA
    Posts
    298
    Real Name
    Ed

    Re: I am confused about bit depth 12-bit vs. 14-bit

    Thank you all for your assistance.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •