CHDK for PowerShot SD770 IS/DIGITAL IXUS 85 IS: Update: Pg2 RAW in 12bit - page 3 - CHDK Releases - CHDK Forum
supplierdeeply

CHDK for PowerShot SD770 IS/DIGITAL IXUS 85 IS: Update: Pg2 RAW in 12bit

  • 238 Replies
  • 105994 Views
Re: CHDK for PowerShot SD770 IS / DIGITAL IXUS 85 IS: Update Now Boots CHDK
« Reply #20 on: 11 / January / 2009, 11:51:43 »
Advertisements
got the image, needs minor tweaking now

indeed 3720x2772x12bpp

unfortunately this requires an update to dng4ps2 also to support this new format

Re: CHDK for PowerShot SD770 IS / DIGITAL IXUS 85 IS: Update Now Boots CHDK
« Reply #21 on: 11 / January / 2009, 13:42:09 »
sounds interesting! looks like you are making some good progress, will change the title to get a few views if the 12bpp is news!

*

Offline kayec

  • *
  • 21
Re: CHDK for PowerShot SD770 IS/DIGITAL IXUS 85 IS: Update: Pg2 RAW in 12bit
« Reply #22 on: 11 / January / 2009, 14:10:24 »
Yes!!  12bit rocks!  This is going to make a big difference in tonal quality compared to the 8bit JPGs it normally produces. 

Not a C programmer so i can't offer much more then moral support but we're with you sharky!  Will have camera back by weekend and will help with any testing...


Re: CHDK for PowerShot SD770 IS/DIGITAL IXUS 85 IS: Update: Pg2 RAW in 12bit
« Reply #23 on: 12 / January / 2009, 15:50:29 »
the 12-bit data is not *that* good actually

the bottom 2 bits look totally random; in fact the whole bottom 4 bits are not adding much information if you ask me :)

but maybe playing with the ISO settings and stuff gets you a little further quality-wise.

I'm attaching the new DISKBOOT.BIN for people who want to look at the format; I'm slightly puzzled by it at the moment since the bit-order in the data file is rather strange. I managed to find the correct 4-bit chunks of data to reconstruct an 8bit-per-channel picture which looks pretty good. Problem is, the bottom 4 bits are hard to match so I can't really see which 4bits go with which colour ..

Anyway, this DISKBOOT.BIN should fix various crashes and save the RAW data. Movie capture is totally untested still but bracketing seems to work OK now too.

The 8-bit decoder in C looks something like this (discards bottom 4 bits):

Code: [Select]
int getpixel(char *data, int x, int y) {
   // Offset into the buffer is y*w+x pixels into the buffer @ 12bpp
   int offset = (y * WIDTH + x) * BPP / 8;
   // Every 4 pixels are grouped into 6 bytes which strange offsets:
   int localoffset = offset % 6;
   // This is the 'base pointer' for a group of 4 pixels (6 bytes)
   char *ptr = data + offset - localoffset;

   switch(x % 4) {
   case 0:
       return ((unsigned int)ptr[3] & 0xf0) << 4 | (ptr[3] & 0x0f) << 4;
   case 1:
       return ((unsigned int)ptr[1] & 0x0f) << 8 | (ptr[0] & 0xf0) << 0;
   case 2:
       return ((unsigned int)ptr[4] & 0xf0) << 4 | (ptr[4] & 0x0f) << 4;
   case 3:
       return ((unsigned int)ptr[2] & 0x0f) << 8 | (ptr[5] & 0xf0) << 0;
}

I have a RAW -> 16-bit, 3-channel RGB without interpolation program to do the testing with, which I have attached. This allows you to load the image in photoshop or somesuch with 16bpp, big-ending (Mac), 3 channels (interleaved), 1860x1386.


*

Offline user1

  • *
  • 20
Re: CHDK for PowerShot SD770 IS/DIGITAL IXUS 85 IS: Update: Pg2 RAW in 12bit
« Reply #24 on: 12 / January / 2009, 15:53:25 »
How about to upload such RAW example?

Re: CHDK for PowerShot SD770 IS/DIGITAL IXUS 85 IS: Update: Pg2 RAW in 12bit
« Reply #25 on: 13 / January / 2009, 03:34:41 »
Ahh, found the correct format, working on DNG export now.

*

Offline kayec

  • *
  • 21
Re: CHDK for PowerShot SD770 IS/DIGITAL IXUS 85 IS: Update: Pg2 RAW in 12bit
« Reply #26 on: 13 / January / 2009, 15:40:46 »
So what's the story?  Is it a 12 bit array but a 10 bit image?  Does that even make sense? 

Re: CHDK for PowerShot SD770 IS/DIGITAL IXUS 85 IS: Update: Pg2 RAW in 12bit
« Reply #27 on: 14 / January / 2009, 02:24:27 »
Seems the ccd is 12 bit, but since the signal-to-noise ratio is pretty low, due to the high amount of pixels (10M) and the tiny size of the CCD (around 5x7 mm), the lower 4 bits contain almost exclusively noise.

See here http://www.clarkvision.com/imagedetail/digital.signal.to.noise/index.html for a discussion on signal-to-noise ratios in digital cameras.

Theoretically, taking multiple exposures (say 16) and combining them into a single image should yield better results with this 12-bit depth than if you were taking 16 exposures in 10 bit.

Bottom line is, the 12 bit will not give you better results than 10 bits in all but a few specialized cases. The illustrate this, I took a picture of a white piece of paper and dumped only the lower 4 bits, here is a JPG of those lower 4 bits: http://www.marjoleinensteve.nl/pattern.jpg The pattern shows that there is SOME information there, but most of it is just noise.

That said, I'm not an expert so feel free to correct me here.
« Last Edit: 14 / January / 2009, 03:01:14 by sharky »


*

Offline kayec

  • *
  • 21
Re: CHDK for PowerShot SD770 IS/DIGITAL IXUS 85 IS: Update: Pg2 RAW in 12bit
« Reply #28 on: 14 / January / 2009, 14:04:12 »
That's crazy art!  I see what you mean though, it is A LOT of noise. 

Re: CHDK for PowerShot SD770 IS/DIGITAL IXUS 85 IS: Update: Pg2 RAW in 12bit
« Reply #29 on: 14 / January / 2009, 15:20:02 »
Just bought an 85IS and found this site (CHDK).  I just tried the DISKBOOT.BIN and it is working. I don't understand half of what I am looking at (I need to find the manual if there is one) but it looks great so far!

 

Related Topics