> > I have looked at the DCRAW sources last week, and one part that is > missing for Pentax PEF format is reading the white-balance as set on > the camera and use that as a basis for the conversion. > > At the moment DCRAW completely ignores that setting, so you have to > specify a specific white-balance correction on every image. > They use a "green-multiply" and a "blue-multiply" value for that. > > So what is needed is some code that interprets the Pentax specific > white-balance camera settings, and translates that to the proper > multiply values for DCRAW. > > But John Francis has been digging deeper into this stuff so I am > pretty sure he will have some more details ...
Well, I know something about what the Pentax code does, at any rate. It looks as though a first guess at values for dcraw green and blue multipliers might be as follows for the eight white balance presets: 1: 0.67 0.62 Daylight 2: 0.61 0.51 Cloudy 3: 0.58 0.44 Shade 4: 0.54 0.52 Daylight Fluorescent Light 5: 0.63 0.69 Neutral White Fluorescent Light 6: 0.70 0.93 White Fluorescent Light 7: 1.05 2.00 Tungsten Light 8: 0.57 0.49 Flash But the translation to RGB space is rsther more complicated than the simple linear scaling that dcraw uses.