How to process DNG files from CHDK

Hi! I have some photos taken with my Canon Powershot S5 IS. They are in RAW format (.DNG).

When I open it to edit, the colors appear to be wrong…

A general question was asked on photography stackoverflow: canon - Why do some DNG pictures from chdk have a purple tint? - Photography Stack Exchange

How can I edit such DNG images in darktable properly? Can “demosaicing” module be customized more?

JPG:

DNG:
IMG_1857.DNG (9.9 MB)

DNG in darktable:

It is the White Balance module that changed it. If I change it from “As Shot to Reference” to “As Shot”, it looks like the top photo (JPG) of your post. Personally, I prefer it as in the bottom photo (DNG in darktable).

So, look into the White Balance module and set things the way you want.

For me I definitely had trouble getting an identical color to the JPG image. By default my image opened with a slight blue/magenta tint which is the opposite effect to what you are seeing. Could you supply your xmp file for people to check if you have a strange setting for white balance or color calibration modules? I could only replicate a similar color to you if I kept WB at the scene refer default but disabled color balance module.

It may also be good to have a nice sunlight scene for comparison as the forest is tricky lighting.

First, I think that camera only outputs .jpg and no raw format. Second, DNG is not really a raw format. It can hold unprocessed raw data, or processed data.

So how did you create the dng?

It’s a firmware hack.

1 Like

Yeah, in this photo the DNG is okay, but I was wondering, if wrong demosaicing could cause more noice… Or the camera is too old

Hmm, there were some settings that darktable applied automatically… And it made it look like this…

Well, I don’t have many photos, but if I’ll find some strange variants, I’ll send them here.

But thanks for mentioning “White balance” and “Color calibration” settings

If you upload a raw and the xmp sidecar (but at least the sidecar), we could have a look. Until that, it’s just guessing, so let us help you.

UPDATE: Actually, Darktable has applied some “scene-related default” Color calibration module, and it made the magenta tint.

JPG:

DNG look:

DNG look without any default settings:

DNG:
IMG_1895.DNG (9.9 MB)

XMP:
IMG_1895.DNG.xmp (6.1 KB)

There’s just the basic processing. In color calibration, you can sample e.g. the road to get a reading.
color calibration depends on darktable’s camera profile having a good ‘camera reference’ white balance. Maybe the values for your camera + CHDK are simply wrong (I would not be surprised, as the camera normally does not support raw).
Possible solutions:

  • use white balance only, setting it to ‘as shot’.
  • pick colour from a neutral spot in color calibration
  • if your screen is properly calibrated to D65, create an override for the camera’s D65 reference – see darktable 4.9 user manual - color calibration

Yes: darktable applies some default processing, depending on the input file and your settings.
Your dng files are supposedly raw files, and scene-referred is the default workflow setting (iirc).

So you will have applied a few modules, some of which are absolutely essential and cannot disabled (shown with a ‘◉’ symbol) and some which are technically not required, but you’ll want them most of the time (marked with ‘⏻’)

If you want as few modules applied as possible, set your workflow to “none” (see the manual)

As @kofa said, in your case some of the values provided in the dng metadata may be wrong. If you can figure out a suitable default for some of the modules, you can create a preset for those with the better defaults, and have those auto-applied (or you can create a style with them, which you will then have to apply “by hand”)

Sorry. From your top post, I didn’t understand your issue.

When I looked at the meta data I think it said the DNG version was 1.0…its seems to be single illuminant and the wb data was a bit weird…the green channel was 1.1644 or something like that and the red and blue were fractional which I have seen before but usually green is 1 or maybe some variants have this…in any case maybe there is weird wb information because going from memory I don’t think DT used values for as shot that matched the meta data but it was a day or two ago when I looked …

thanks for the answers! omg, you are such professionals

(Looking forward to understand all of this :smile:)