• Please use real names.

    Greetings to all who have registered to OPF and those guests taking a look around. Please use real names. Registrations with fictitious names will not be processed. REAL NAMES ONLY will be processed

    Firstname Lastname

    Register

    We are a courteous and supportive community. No need to hide behind an alia. If you have a genuine need for privacy/secrecy then let me know!
  • Welcome to the new site. Here's a thread about the update where you can post your feedback, ask questions or spot those nasty bugs!

The Canon sRaw and mRaw output formats - updated technical article

Doug Kerr

Well-known member
The Canon sRaw and mRaw output formats have for a while been a mystery to me. I published a technical article "explaining" them, but in fact my understanding at the time was rather imperfect.

Recently I returned to my study of this topic, and finally (mostly) "cracked" the secret.

For the sRaw format (the easiest one to understand):

• The raw data in the file represent an image with half the pixel dimensions (one-quarter the pixel count) of the image represented by the regular Raw file (which is normally the largest image size available for a JPG output from the camera)

• Each Bayer sensel cluster on the sensor (one R sensel, two G sensels, and one B sensel) has the task of capturing one pixel of the sRaw "image" (sometimes described as a "fat pixel"). Accordingly, when developing the image from the sRaw data, no demosaicing is needed.

• The Raw data from each cluster (each "fat pixel") is encoded in a form that is conceptually identical to the sYCC encoding used for the image R, G, B data in a JPEG image file. (The two G outputs have been consolidated before this is done, so there are only three values to be encoded.)

• The two components of this encoded format that are comparable to Cb and Cr in an sYCC format (which here represent something very much like chrominance) are dropped for every other pixel (conceptually identical to the chrominance subsampling used in sYCC).

• The data is compressed with a reversible ("lossless") encoding system.


The overall implications are:

• The image that can be developed from an sRaw file has half the pixel dimensions (one-fourth the pixel count) of the image that can be developed from a regular Raw file.

• The sRaw file size is about half the size of a regular Raw file for the camera. (That may be surprising, given that only one-fourth as many pixels are represented; the reason is given in the next item.)

• Each pixel of the represented image is captured by a tricolor "pixel" in the sensor, so no demosiaicing is required to develop the image. This of course increases the "bits per pixel" of the sRaw data compared to a regular Raw file, which is why the sRaw file is not as small as we might at first expect.

• There is some exposure to error in the decoded Raw data (from which the image will be developed) owing to the "chrominance subsampling" used in the sYCC-like encoding arrangement.


The mRaw format follows similar principles, but the details are more complicated, and I will not explain them here (I actually do not fully understand them). In any case:

• The image that can be developed from an mRaw file has about half the pixel count of the image that can be developed from a regular Raw file.

• The sRaw file size is about 3/4 the size of a regular Raw file for the camera.


I have updated my technical article, "The Canon sRaw and mRaw Output Formats". It is indexed here:

http://dougkerr.net/Pumpkin/index.htm#sRaw

Best regards,

Doug
 
Last edited:
Top