Well, I shot a few RAW images from my S5
I've never really worked with RAW images before (let alone dcraw), so I don't know if I'm doing it right... but it seems like I only get 'good' output when I set the top margin to 15 px (it should be 16 px according to the offset relative to the generated .jpg file, but I don't get *ANY* green except for in overexposed areas in that case, my image will be purple and I lose quite a bit of information when I do manage to get the colors somewhat correct). Actually, I do not see a positioning difference between 15 and 16 but I do still see a difference between these and the 'reference'. This is possibly caused by the sharpening the camera applies, though. Judge for yourself, I'll try setting it to 17 in a bit
Anyway, even then, it's very green (is that supposed to happen?). It can be fixed by telling dcraw where to find something white, else it's a bit hard to fix... but I just need minor modifications afterwards, so that's fine, I guess
.
RAW image converted to jpeg, set the white balance to something sensible, NO noise reduction (notice the hot pixels, especially in the dark areas), no shapening, and I made it a bit brighter.
'Reference' jpg image made by the camera, auto white balance (it's way off) and quite dark.
Settings: ISO 80, 1.6", F8. I should have shot with a lower F-number, I guess.. but it's a bit hard to tell through a
live hexdump :p
About the RAW conversion strangeness:
top_margin=15 No whitebalance, no postprocessing (wall color is really close though, better than in my processed image, but the screen should be #FFFFFF)
top_margin=16 No whitebalance, no postprocessing. I don't know what causes this but it's clearly unusable. Possibly a misalignment (starts at byte 2 instead of byte 0 or vice versa?) but I'd expect it to be correct for even offsets, not for odd ones..
Adding support in dcraw was straightforward, just search for 'S3 IS', copy that part and paste it right below there, changing the appropriate values, so you'll end up with the following code:
} else if (!strcmp(model,"PowerShot S5 IS")) {
height = 2448;
width = 3264;
raw_height = 2480;
raw_width = 3336;
top_margin = 15;
left_margin = 24;
load_raw = &CLASS canon_a5_load_raw;
I *think* these margin values are correct, but it's mostly trial-and-error.
Also, you'll need to add the filesize to the table (located elsewhere, search for "S3 IS" again) so the file can be identified
{ 10341600, "Canon", "PowerShot S5 IS",0 },
This might cause a problem though, but it's just minor. The offsets, sizes and such appear to be exactly the same as in the A720, so the only problem this will cause is that A720 files are identified as S5IS files. This shouldn't really matter, though, as I expect both cameras to generate the same data.
The above mentioned problems could also be caused by the canon_a5_load_raw function, but as I said, I don't know too much about RAW photography and I especially don't know how to interpret the sensor data (yet), so this will have to do.