gustavo@N4050:~/Pictures/2020/20200214_cr2_uniwb$ dcraw -w -v -H 0 IMG_6915.cr2
Loading Canon EOS 5D image from IMG_6915.cr2 ...
Scaling with darkness 128, saturation 3692, and
multipliers 1.291240 1.164960 1.000000 1.164960
AHD interpolation...
Converting to sRGB colorspace...
Writing data to IMG_6915.ppm ...
gustavo@N4050:~/Pictures/2020/20200214_cr2_uniwb$ dcraw -w -v -H 1 IMG_6915.cr2
Loading Canon EOS 5D image from IMG_6915.cr2 ...
Scaling with darkness 128, saturation 3692, and
multipliers 1.000000 0.902203 0.774449 0.902203
AHD interpolation...
Converting to sRGB colorspace...
Writing data to IMG_6915.ppm ...
gustavo@N4050:~/Pictures/2020/20200214_cr2_uniwb$ dcraw -w -v -H 2 IMG_6915.cr2
Loading Canon EOS 5D image from IMG_6915.cr2 ...
Scaling with darkness 128, saturation 3692, and
multipliers 1.000000 0.902203 0.774449 0.902203
AHD interpolation...
Blending highlights...
Converting to sRGB colorspace...
Writing data to IMG_6915.ppm ...
gustavo@N4050:~/Pictures/2020/20200214_cr2_uniwb$ dcraw -w -v -H 3 IMG_6915.cr2
Loading Canon EOS 5D image from IMG_6915.cr2 ...
Scaling with darkness 128, saturation 3692, and
multipliers 1.000000 0.902203 0.774449 0.902203
AHD interpolation...
Rebuilding highlights...
Converting to sRGB colorspace...
Writing data to IMG_6915.ppm ...
dcraw’s “-H” modes don’t change the ratio between the multipliers. The modes do change the normalisation of the multipliers. “-H 0” normalises so the smallest multiplier is 1.0 (it divides all multipliers by the smallest). The other modes normalise to the largest multiplier is 1.0 (it divides all multipliers by the largest).
Can you explain how you did this?
I thought the purpose of uniwb was to set all multipliers to 1.0 in the camera. But I could be wrong.
For the same motivation that drove the first “uniwb developers” to devise it, as stated by one of the first users here.
EDIT: Also, a recommended reading:
Let’s think through the problem. I think the purpose of (the rather awkward) UniWB is to make the JPEG driven histogram in the camera behave as if it were a raw one. This ruins the JPEG and so there is no point using the JPEG+RAW mode as you have.
To approach this problem, I would first need to take a photograph of a evenly soft illuminated grey card near saturation. If I know the properties of the card and lighting, I would know what WB, etc., settings to change to make the histogram behave in the way I want it to.
Now here are the multipliers that (I believe) you should be examining. I say “(I believe)” because I haven’t done this in a long time and every camera has different metadata. If I recall correctly, you could ask exiftool or maybe it was exiv2 to expose the full name of the tags to make sure you have the right one(s).
If these are the correct ones, then you can clearly see that the ratio is off from R=G=B. Clearly something is wrong. If I recall correctly, Mr Kasson’s quick method depends on your monitor being calibrated / profiled in a particular way.
I noticed something else in your metadata.
Picture Style : User Def. 1
Picture Style User Def : Standard; Standard; Standard
In my opinion, it shouldn’t be Standard but Neutral. If you don’t have Neutral, then Faithful. Basically, turn down or off anything that would affect the JPEG and make it more abstract from what the “raw” output would be (e.g., sharpening, non-linear modes).
PS I noticed that your dcraw output says 3692 as saturation. At 12 bit, it should be 4096 as the max value. I wonder why dcraw would use the former value…
I’m not familiar with Canon exiftool results, but I think the “Measured RGGB” mentioned by @afre is what the camera measures from the scene. But the camera is set to use a custom WB, isn’t it, so it ignores the measured RGGB?
These are exactly the ratios given by @gadolf above, but in RGBG order:
dcraw …
multipliers 1.291240 1.164960 1.000000 1.164960
I think the goal of uniwb is to get all four multipliers the same, or at least very close. Perhaps the camera has the ability to dial down the red channel slightly, and dial up the blue channel slightly. Take another photo, and what does “WB RGGB Levels As Shot” say?
Ideally, cameras would have a simple ability to set the four multipliers. Alas, that would be too simple.
I used measured because (I believe) that is what the camera actually sees. If you think of it another way, in measured, the reds are lacking; so in the WB settings, we give red more weight. In any case, @gadolf should be able to verify the appropriate tags.
Yes, I saw that.
But I wanted to start from scratch. Anyway, since my camera is rather old (5D from 2005), I thought it would be better to do it manually so that I ended up having measurements according to this specific camera, not a generic 5D image probably produced by a healthier 5D camera than mine.
What I mean is that you do your part and then compare his metadata with yours. I had trouble downloading it via Firefox so I used a separate downloader. Here is the file for reference: uniwb5d.cr2 (11.5 MB).
I see.
I was already doing that, but since you’ve made it, thanks.
In summary, his uniwb5d.cr2 shows:
dcraw
gustavo@N4050:~/Pictures$ dcraw -w -v uniwb5d.cr2
Loading Canon EOS 5D image from uniwb5d.cr2 …
Scaling with darkness 127, saturation 3692, and
multipliers 2.381836 1.000000 1.230469 1.000000
AHD interpolation…
Converting to sRGB colorspace…
Writing data to uniwb5d.ppm …
gustavo@N4050:~/Pictures/2020/20200213_cr2_uniwb$ dcraw -w -v IMG_6909.cr2
Loading Canon EOS 5D image from IMG_6909.cr2 …
Scaling with darkness 128, saturation 3692, and
multipliers 1.972656 1.000000 1.448242 1.000000
AHD interpolation…
Converting to sRGB colorspace…
Writing data to IMG_6909.ppm …
EDIT: Take note that what I call “my uniwb5d_gadolf” is the image I took from the screen after following all the steps to produce the image that will bring jpeg wb closer to raw, which, in my case, is IMG_6909.cr2
I am confused by the image above of Mr Lujik’s. His maximum deviation looks like he is doing R-G=5.6%. If we do that with the provided CR2 or yours, we get a huge difference. Something is amiss.
Yeah, mine is 1.291240 - 1.164960 = 0.12628, or 12.6%, which is more than double the recommended channel deviation of around 5%.
Well, although I still don’t understand why in first place dcraw doesn’t show 1.000 for G for an image taken with uniwb, from the tests I made so far I have a somewhat approximate “raw histogram” in my camera.
following quick read… don’t get too tangled up with magenta things… as I recall Canon DSLRs will take an over exposed image of say a white sheet of paper as the custom W.B. reference image. Then when you shoot and check the multipliers, they are near perfect as I recall.
I found I had to “calibrate” by checking the clipping (using RT’s raw histogram) and comparing with the camera histogram. I decided I wanted the limit to be inside of the far right of the cam hist. So my cam jpeg settings are minimum contrast and saturation. Then clipping starts about half way through the rightmost of the 5 divisions in the cam hist for my 5D.
I’m not sure if I get all of those UniWB/ETTR concept right however I’ve abandoned the pursuit for the UniWB for the following reason:
I don’t want to clip highlights but my camera operates on JPGs not RAW (most digital cameras do). Thus exposure, histogram and highlight clipping alert are all derived from processed image not raw data.
My way of thinking is that I want as linear image as possible (Neutral, Natural, Mild… whatever your camera jpg style is) with reduced contrast, saturation, sharpness and so on (in my camera I have Natural image scene with all set to -5). Then I will want set WB. Having that I have, as I assume, approximation of RAW which will appear in Darktable. My tests confirms that more or less. The best approximation is with ColorChecker which mach exactly (highlights clipping). Other scenes are more then less accurate. Definitely not that I have 2EV headroom but rather 0.3. Worst case is when I need to adjust WB in Darktable. Then from initial correct image (no clippings) I go to clipped image.
My concern is that I have UniWB set on camera and set exposure accordingly then at least in Darktable I run into trouble. White Balance opens the pipeline and if I apply multiplies on channel values for right WB then I may go to far. Next in the pipeline is highlight recovery which will clip my channel(s). A few modules later exposure kicks in but it’s too late. Or it isn’t?
Is my way of thinking correct?