• 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" output formats

Doug Kerr

Well-known member
With the EOS 1D Mark III, Canon introduced a new output format called sRAW ("small RAW"). It carries an image with exactly half the pixel resolution of the "native" format (1/4 the pixels), and is said to provide to the photographers many of the same advantages as given by the RAW format with a much smaller file size, for situations where a lower pixel resolution is appropriate to the task. The format was also made available on the EOS 40D.

With the EOS 7D, a second related format, mRAW ("medium RAW")was added. It carries an image with a pixel resolution very nearly sqrt(2) that of the native format (1/2 the pixels). Later, "sRAW" came to be called "sRAW2", and mRAW became "sRAW1".

Canon has not been forthcoming about the technical details of these formats. Thanks to reverse engineering work by various of our colleagues, notably Laurent Clevy and YANG Gao, and valuable input from Dave Coffin, developer of the raw processing engine "DCRAW", I have a fairly credible picture of what is going on.

I will give a brief summary here of what seems to be the best guess as to how this works.

**********

The concept of raw coordinates

We note first that the raw data itself (even in the conventional raw format) is in a system of three values (one, "G", comes as the twins, G1 and G2, but we will ignore that) which are not the coordinates of any color space (not even a "proprietary" one). By that I mean that a set of three values does not necessarily precisely represent a particular color - it "sort of" does. (That itself may be a shock to some. It is rather separate from the matter of white balance color correction, although intertwined with it.) We will refer to these three values as the raw coordinates.

This matter is not unique to the sRAW formats - this is just to explain why I speak just of "coordinates" and not "color space coordinates" for the raw data.

The sRAW formats

As near as we can determine, the sRAW formats are basically generated this way:

• The camera demosaics the sensor data in a way that results in a set of values for every pixel of a reduced-resolution image. This data is in the raw coordinate system, not in terms of the coordinates of any actual color space. Dave Coffin also tells me that some type of automatic white balance color correction is applied during this process in order to avert large imbalances between the three kinds of values.

• The raw data for each pixel of the smaller image (and think of these as pixels, not sensels) is recoded into a form very similar to the YCbCr form used in a JPEG file to represent the R, G, and B coordinates of each pixel, but with some differences. In the JPEG case, the nonlinear coordinates of the sRGB color space are recoded into YCbCr form. Here, the linear raw coordinates are recoded in a similar way. The results have a totally different significance.

• In the case of sRAW1 (sRAW), the set of Cb and Cr values is decimated, only one pair being retained for every other pixel (presumably using some type of interpolation, not just discarding half the values). This is in fact chrominance subsampling, just as we have in JPEG encoding, this specific arrangement being called 4:2:2.

In the case of sRAW1 (mRaw), the same is done, but now there is only one pair of Cb and Cr values for a block of four pixels (4:2:0 chrominance subsampling).

• The data is compressed with reversible ("lossless") JPEG compression and packed into a file.

That's it.

So, how is this "RAW"?

Since the pixel-organized data of the sRAW formats is in the raw coordinate system, with a substantial bit depth (potentially 15 bits, apparently), in the subsequent processing we can still, as with regular raw data:

• Compensate for improvident exposure.

• Apply white balance color correction at a good stage in the pipeline (presumably the software will take account of what the camera already does, which I presume is defined in the metadata).

• Use what we think might is the best way to map between the non-color space raw coordinates and a real color space.

• Apply appropriate tonal scale mappings.

What we can't do is use a demosaicing algorithm of our own choice - the demosaicing was done earlier, in the camera.

So I guess it's partially cooked.


Best regards,

Doug
 

Doug Kerr

Well-known member
I'd be interested in hearing from any members who have used either of the Canon sRAW output formats - including what task seemed to commend itself to that, and how did it work out.

Thanks.

Best regards,

Doug
 

Ben Rubinstein

pro member
I haven't used it but I can report that fellow wedding photographers using it on the 5DII are reporting a noticeable decline in DR and colour shifts and innaccuracies.
 
Top