How to convert S95 CHDK CRW format to DNG - RAW Shooting and Processing - CHDK Forum supplierdeeply

How to convert S95 CHDK CRW format to DNG

  • 19 Replies
  • 13357 Views
How to convert S95 CHDK CRW format to DNG
« on: 29 / August / 2011, 10:32:27 »
Advertisements
By accident I made two errors: not checking DNG and using low resolution JPG. So, I have 100 diving photo's in S95 CHDK CRW format that I need to convert to DNG. UFRaw, DNG4PS2 and RawTherapee do not read them. I know they are just a dump of the sensor data and I can write software, but without any specification this is impossible. Is there any software solution or specification available to solve this problem?

*

Offline reyalp

  • ******
  • 14080
Re: How to convert S95 CHDK CRW format to DNG
« Reply #1 on: 29 / August / 2011, 12:29:28 »
You can create a profile for DNG4PS2 http://chdk.setepontos.com/index.php?topic=6754.0

You can find the details of your cameras sensor layout in the platform_camera.h file for your camera. For s95, this is  http://www.assembla.com/code/chdk/subversion/nodes/trunk/platform/s95/platform_camera.h?rev=1308

Don't forget what the H stands for.

Re: How to convert S95 CHDK CRW format to DNG
« Reply #2 on: 29 / August / 2011, 18:21:34 »
Thanks for the information. However, I am not sure this will work. This means DNG4PS2 can be applied to camera's with a Digic-4 processor, like the S95, while the readme_en.txt says "DNG for PowerShot-2 (DNG4PS-2) is free software for converting RAW files from Canon PowerShot cameras with Digic-II processor", so I assumed DNG4PS2 would work for the S95. May be some one can tell me this is no problem before I follow this advice?

Re: How to convert S95 CHDK CRW format to DNG
« Reply #3 on: 29 / August / 2011, 18:35:27 »
May be some one can tell me this is no problem before I follow this advice?

If you look at the article linked by reyalp, it references an IXUS100 - a Digic-4 camera.

Ported :   A1200    SD940   G10    Powershot N    G16


Re: How to convert S95 CHDK CRW format to DNG
« Reply #4 on: 29 / August / 2011, 19:58:38 »
Thanks. It seems to work! I used the following, which did show a picture in photoshop, but I still need to fill in the right Black-white levels and matrix to get the colors ok.

Sensor size: 3744 x 2784
Jpeg size: 3648 x 2736
Active zone x1, y1: 64, 22
Active zone x2, y2: 3728, 2782
Black-white levels: wrong and just a guess
Mosaic type Red,Green Green,Blue
Bits per unit: 12 bit
Illuminant: Standard Light A
Matrix: wrong and just a guess
Multiplicator: 1.0 1.0 1.0

Re: How to convert S95 CHDK CRW format to DNG
« Reply #5 on: 30 / August / 2011, 00:23:35 »
Welcome to the world of CHDK RAW files.  With a bit of work your images can look just as good as the jpg your camera already produces.   With a lot of work you can probably make your image look slightly better.  Have fun !
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: How to convert S95 CHDK CRW format to DNG
« Reply #6 on: 30 / August / 2011, 00:35:51 »
Thanks. It seems to work! I used the following, which did show a picture in photoshop, but I still need to fill in the right Black-white levels and matrix to get the colors ok.

Sensor size: 3744 x 2784
Jpeg size: 3648 x 2736
Active zone x1, y1: 64, 22
Active zone x2, y2: 3728, 2782
Black-white levels: wrong and just a guess
Mosaic type Red,Green Green,Blue
Bits per unit: 12 bit
Illuminant: Standard Light A
Matrix: wrong and just a guess
Multiplicator: 1.0 1.0 1.0

Black level = 127
White level = 4095
Color matrix (from DCRAW) = 1.3440 -0.5896 -0.1279 -0.1236 0.9598 0.1931 -0.0180 -0.1001 0.4651

I can't remember if you need commas between the matrix values or not. If matrix doesn't work try it with commas.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

Re: How to convert S95 CHDK CRW format to DNG
« Reply #7 on: 30 / August / 2011, 03:45:52 »
Welcome to the world of CHDK RAW files.  With a bit of work your images can look just as good as the jpg your camera already produces.   With a lot of work you can probably make your image look slightly better.  Have fun !

I can assume you (at least for the A495) that with only a minimal amount of fiddling in e.g. RawTherapee the images transformed from CHDK RAWs (DNGs more precisely) are WAY better than the original JPEGs. The chromatic aberration so ugly in the original JPEGs can be reduced a lot using simply the auto CA correction option, while a less aggressive compression factor preceded by RL or USM sharpening give you much better looking JPEGs with smaller file sizes.


Re: How to convert S95 CHDK CRW format to DNG
« Reply #8 on: 30 / August / 2011, 06:55:40 »
Finally, I used this

Sensor size: 3744 x 2784
Jpeg size: 3648 x 2736
Active zone x1, y1: 64, 22
Active zone x2, y2: 3728, 2762
Black-white levels: 127 - 4095
Mosaic type Red,Green Green,Blue
Bits per unit: 12 bit
Illuminant: Daylight
Matrix: 0.13440 -0.05896 -0.01279 -0.01236 0.09598 0.01931 -0.00180 0.01001 0.04651
Multiplicator: 1.0 1.0 1.0

- Black-white levels 127 - 4095, see post of philmoz in this thread;
- Illuminant: Daylight, my guess;
- Matrix: 0.13440 -0.05896 -0.01279 -0.01236 0.09598 0.01931 -0.00180 0.01001 0.04651, see source code dcraw.c http://www.libraw.org/download
"Canon PowerShot S95", 0, 0,
 { 13440,-5896,-1279,-1236,9598,1931,-180,1001,4651 };
- everything else, see source code chdk Camera - S95 - platform_camera.h http://www.assembla.com/code/chdk/subversion/nodes/trunk/platform/s95/platform_camera.h?rev=1308.

I conclude that the chdk source code Camera - S95 - platform_camera.h can be improved by using the right color matrix from dcraw.c. I don't know if this has anything to do with the wrong colors of my JPG files, created with custom white balance using a white card. The colors of the DNG files I generated from CHDK CRW with the above settings are much better.

*

Offline vit40

  • ****
  • 276
Re: How to convert S95 CHDK CRW format to DNG
« Reply #9 on: 30 / August / 2011, 08:48:36 »
Hm ... is there a reason for using CHDK/dng raw files, as S95 supports native cr2 raw files, which are saved faster in the camera and supported properly by various programs?

Matrix in dcraw is probably taken from Adobe, by simply converting native cr2 file to a dng with Adobe dng converter and reading matrix from that dng file. BTW, dcraw supports only one color matrices, while dng converted from native cr2 has four matrices

 

Related Topics