All images © Bob Atkins

19.jpg

This website is hosted by:
Host Unlimited Domains on 1 Account

9.jpg

Welcome, Guest. Please login or register.

Login with username, password and session length
 
Web www.bobatkins.com
*
+  The Canon EOS and Photography Forums
|-+  Photography Forums
| |-+  The Canon EOS Forum
| | |-+  50D: RAW SRAW1 SRAW2 a question
« previous next »
Pages: [1]
Print
Author Topic: 50D: RAW SRAW1 SRAW2 a question  (Read 15075 times)  bookmark this topic!
raff
Newbie
*
Posts: 7


50D: RAW SRAW1 SRAW2 a question
« on: December 27, 2008, 04:52:38 AM »

I taked the Eos 50D.
I have a doubt about the 3 levels of RAW registration.
I believed that the SRAW1 and SRAW2 have the same dimension of image, but a compression added.
It is not so.
For example the SRAW1 produces an image with 3267x2178 pixels against the 4752x3168 pixels of the RAW. (Less than the 20D!)

The main question: how are obtained these smaller images?

Maybe the camera registers a full-size image and after it comes reduced with an interpolation?
And wich type of interpolation? (I know that the D3 Nikon makes a "condensation" of pixels and so obtaines a better  issue in the high-ISO images.)

Or maybe the camera "read" and registers less pixels immediately?

An other doubt: The SRAW1 makes an image of 7.1 MP (3267x2178), the M-JPG makes an image of 8.0 MP (3456x2304): why this difference?

And, again, the advantage in using the SRAWs, is ONLY the reduced size of the file? Or it exist a better quality in some situations?

Canon says nothing about this.

Thank You if You can help me!
Raff
Logged
Bob Atkins
Administrator
Hero Member
*****
Posts: 1253


Re: 50D: RAW SRAW1 SRAW2 a question
« Reply #1 on: December 27, 2008, 11:23:22 AM »

sRAW (small RAW) has the advantage of enabling post exposure processing using a program like Canon's DPP, which allows you a greater degree of correction than a JPEG would. It's only advantage over RAW is that the sRAW files are smaller.

RAW and sRAW files use lossless compression. They differ in terms of the number of pixels. I would assume that the entire image is captured at full resolution and then the pixels are interpolated for the sRAW format. That's the only way Canon could do it since the image is not cropped. Canon have not released any information on the algorithm that they use, but I have some some "reverse engineering" analysis which suggests that the sRAW format is at least partially demosaiced and each pixel retaines an original green component signal, but half the pixels have only a red component and the other half have only a blue component. I've also seen it suggested that the data in the sRAW files is in 15 bit format rather than 14-bit format in order to include the increased precison which can be required when two pixels are averaged.

sRAW2 is somewhat easier to underatnd than sRAW1 since sRAW2 is 1/4 of the size of the the full RAW file and so can be thought of as "averaging" each 2x2 pixel block into a single pixel. This is OK because each 2x2 block has green, red and blue color information (2 green, 1 red and 1 blue). sRAW1 is half the size of the original RAW file. It may be done by averaging 2 pixels, but in that case of course half the pixels wiould have (green + red) data and half would have (green + blue) data. The exact algorithm Canon use is unknown.

This does mean that you lose some information going to sRAW. If you want the best possible image which retains the maximum amount of information, use RAW

RAW files are larger then equivalent JPEGs because they are lossless. In JPEG files some information is lost due to compression and so for a given number of pixels they can be smaller.

If you want a techical description of the RAW format (with some limited sRAW data), take a look at http://lclevy.free.fr/cr2/ but be warned that it's pretty heavy going!
« Last Edit: December 27, 2008, 11:56:48 AM by Bob Atkins » Logged
raff
Newbie
*
Posts: 7


Re: 50D: RAW SRAW1 SRAW2 a question
« Reply #2 on: December 28, 2008, 02:22:03 AM »

Thanks for your answer, Bob.
I will do some "experiments" to valuate if the SRAW1 of the 50D is better or not respect the 20D RAW. It is smaller anyway. (And SMALLER than half full format)
Second question - about the difference of dimension between SRAW1 and JPG, the problem is the contrary.
The SRAW1 file is SMALLER than the equivalent JPG.
The SRAW1 makes an image of 7.1 MP (3267x2178), the M-JPG makes an image of 8.0 MP (3456x2304).
This was my doubt.

Thanks again, and I wish to You an Happy New Year!
Raff
« Last Edit: December 28, 2008, 02:24:45 AM by raff » Logged
lclevy
Newbie
*
Posts: 2


Re: 50D: RAW SRAW1 SRAW2 a question
« Reply #3 on: December 29, 2008, 11:01:14 AM »

Hello,

Thanks Bob for having put a link to my CR2 document.

A people called Gao Gao from Singapore told interesting things about sraw while observing dcraw code source :
may i put a direct link to his message ?

in short:
1. sraw are encoded (after jpeg lossless decompression) in YCbCr format (luminance/chrominances), more accuratly :
   odd column pixels contains Y,Cb,Cr,0 and even column pixels Y, 0, 0, 0.
   missing Cb and Cr information is done by averaging neighbor values (ip[1] = ( ip[-3] + ip[5] ... and the following line in dcraw)

2. this YCbCr information is than converted into RGB
(for example in dcraw : pix[1] = Green = Y - (778/(2^12))*Cb - ((2^11)/(2^12))*Cr = Y - 0.19 Cb - 0.5 Cr)

I'll update my document as soon as this information is double checked and I have fully understood the dcraw swraw decoding.

Laurent
Logged
lclevy
Newbie
*
Posts: 2


Re: 50D: RAW SRAW1 SRAW2 a question
« Reply #4 on: January 07, 2009, 02:15:43 PM »

Hello,

a lot a details is now available here:
http://lclevy.free.fr/cr2/#sraw

- sraw and sraw2 are in 4:2:2 YCbCr
- sraw1 are in 4:1:1 YCbCr

Laurent
Logged
Pages: [1]    
Print
« previous next »
Jump to: