Re: Raw File Formats




"Roger" <rogerb@xxxxxxxxxxxx> schreef in bericht news:mzn%j.10267$ED6.6089@xxxxxxxxxxx
I am struggling, trying to understand the format of RAW files.
I understand the is a luminosity channel (12 or 14 bits, depending on the
camera) for each pixel which accounts for the bulk of the information,
plus color information.
Here I thought there would just be three 12-bit (or 14 bit) for each
color channel but, for an 8 MP camera, this would result in a 36MB (1.5
bytes * 3 * 8 *10^6) file which is certainly not the case (even
considering benefit from any loss-less compression). How can Canon fit an
8MP color RAW image into an ~8MB file?



Are there really only 8MB/3 = 2.67MP (multi-colored MP's) from a "8MP"
camera?

Nope, there are 8MP/4 = 2 MP (multi-colored MP's) from a 8MP.
(One multi-colored pixel containing Green,Red, Blue, Green)

Each pixel of the 8 MP can hold 12 or 14 bits of information. Using compression this can be reduced to less than 8 Mb.

A way to do the compression:

With 12 bits there are 4096 differenct value's. Count how much each value occure's in the picture. The value's occuring the most get a short code, the value's occuring the least get a long code. This coding is done for each color. This probably will reduce the picture a bit. Offcourse the coding sceme takes space as will in the coding sceme.

Better:
Localized compression. For each color calculate the difference from the previous occurence of this color and code that, so the changes from pixel to pixel are stored. On normal pictures the changes are not large on average. Offcours changes occuring a lot should get short codes, changes occuring less should get long codes.

Loads of other compression scemes are possible.

And mayby (???) the compression Canon uses is not completely lossless.
Nikon certainly has used scemes whereby the compression is not loseless in their Raw formats.

So the raw containes 1.5*8*1E6 / compression factor bytes. To get 8 Mb the compression factor has to be 1.5.

ben brugman

.



Relevant Pages

  • Re: A couple of newbie questions
    ... if you buy a 6mp camera each pix will be ... good luck and happy pix... ... ARAWfile has each individual color pixel to sensor depth so a 6 Mpix ... This does not account for compression, which, as the dynamic range ...
    (alt.photography)
  • Re: Differential intra-interchannel filters for RGB images lossless compression
    ... >>> However IMHO many photographic images are even slightly more difficult ... don't look right, lighting doesn't look right, surfaces are almost always ... compression, it seems concievable to me that they could. ... would likely be able to fairly accurately predict the pixel. ...
    (comp.compression)
  • Re: recommendation for digital camera -=> Shameless Nikon plug
    ... > because each pixel is only R, G, or B straight from the CCD.) ... In the tiff file you have three colors per pixel and 8 bits per ... lossless compression and not uncompressed versus compressed, ... That should rival the Nikon capture software. ...
    (Debian-User)
  • Re: File Size Question
    ... In 8 bit JPEG format, it takes 3 bytes to represent one pixel. ... your 10 Megapixel camera makes IMAGES that are around 30 Megabytes. ... JPEG uses highly efficient lossey compression. ...
    (rec.photo.digital)
  • Re: PALETTE COLOR Ultrasound Images without palette
    ... Several vendors discovered JPEG compression of color ultrasound images ... would attempt to interpret decompressed YBr pixel component values as ... There is a CP describing compression of palette color images: ...
    (comp.protocols.dicom)