Debian stable; RT 5.9; Canon EOS R5; results not what I expected; what have I done wrong?

I upgraded to Debian Bookworm which made the rawtherapee version 5.9. It has been a few years since I have used rawtherapee and I have forgotten much.

I downloaded a DCP file for my Canon EOS R5. I copied the DCP file and /usr/share/rawtherapee/camconst.json to the ~/.config/rawtherapee directory. I edited the json file to change the white level and clipping. The reason for changing the clipping was to account for IBIS moving the sensor. I chose a value that is often in the exif for the white level.

diff /usr/share/rawtherapee/camconst.json ~/.config/RawTherapee/camconst.json 
1219c1219
<         "raw_crop" : [ 128, 96, 8224, 5490 ],
---
>         "raw_crop" : [ 64, 64, 8352, 5586 ],
1221c1221
<         "ranges" : { "white" : 16382 }
---
>         "ranges" : { "white" : 14008 }

Some image files seem to work very well and others not at all. I suspect I have done something wrong.

Examples were not keepers, but for me learning how to use rawtherapee.

This image is screen capture from rawtherapee:

/home/jrm/src/libraw2021dec18/LibRaw-master/bin/dcraw_emu -v -T -6  IMG_4331.CR3

rawtherapee again

/home/jrm/src/libraw2021dec18/LibRaw-master/bin/dcraw_emu -v -T -6  IMG_4319.CR3 

What have I done wrong? Thanks in advance.

I don’t understand why you changed the crop (so that you see the optical black field) or changed the white level (to make it brighter).

Thanks for your response.

Changing the white level to a number close to what the camera reported seemed to me to make the image darker and bring out more color.

exiftool -G0:2 -s -a -"*WhiteLevel" -"*BlackLevel" IMG_4319.CR3 IMG_4331.CR3
======== IMG_4319.CR3
[MakerNotes:Camera] NormalWhiteLevel            : 13535
[MakerNotes:Camera] SpecularWhiteLevel          : 14888
[MakerNotes:Camera] PerChannelBlackLevel        : 2048 2048 2048 2048
======== IMG_4331.CR3
[MakerNotes:Camera] NormalWhiteLevel            : 13535
[MakerNotes:Camera] SpecularWhiteLevel          : 14888
[MakerNotes:Camera] PerChannelBlackLevel        : 2048 2048 2048 2047
    2 image files read

Maybe I should have used 14888 or 13535 instead of 14008. The camera chose 14888 instead of 14008 for this image. So far as I know, libraw/dcraw_emu uses one of the white level values from the metadata in the image file and gets a better result, but that might depend more upon the black level. I was under the impression that specular white level needed to be low enough to get color, but I might be wrong.

Cropping:
The camera has in body image stabilization (IBIS). IBIS moves the sensor to stabilize the image and the in camera crop varies unless the camera is on a tripod and not moving. I did not see an option to use the crop that the camera chose, so I chose one large enough to include any that might happen thinking I could crop later. Does including part of the black border mess up the lightness or colors?

Maybe 108 or 112 would be better for sensor top border than 64 since the camera often chooses one of those values. The camera often chooses 144 for sensor left border.

I must be misunderstanding something.

Thanks again.

John

I put the CR3 raw file on my web server at https://www.rsok.com/~jrm/raw/IMG_4319.CR3
and the SOOC JPEG at https://www.rsok.com/~jrm/raw/IMG_4319.JPG

Don’t touch the raw crop. It has nothing to do with IBIS. What does have is lens correction. I haven’t found any exif tag for Canon and IBIS movement.

The black frame to the left and above is normally used to generate the correct black level Measure black and white levels?

How the white level for R6 CR3 was done for RawTherapee Canon R6 CR3 support · Issue #5901 · Beep6581/RawTherapee · GitHub

Your raw file seems similar to the JPEG in RawTherapee, without any DCP.

1 Like

Thanks for your response. I have removed the DCP file and the edited camconst.json and this is what I see:

The difference seems to be that your version of RT can read the exif data? Is the version included with Debian stable too old?

Thanks again.

John

I use the Appimage Call for testing: RawTherapee metadata handling with Exiv2 (includes CR3 support)

1 Like

Thanks. The version seems to be the explanation.

John

1 Like

Building metadata-exiv2 branch.

Get warning about sprintf. Do I need to check that code for security problems? Or, has someone else already done so?

**/home/jrm/src/code-rawtherapee/rtengine/dcraw.cc:** In member function ‘**void DCraw::identify()**’:

**/home/jrm/src/code-rawtherapee/rtengine/dcraw.cc:10185:15:** **warning:** ‘**sprintf**’ argument 3 may overlap destination object ‘**this**’ [**-Wrestrict**]

10185 | **sprintf (model+20, "DYNAX %-10s", model+6+(model[0]=='M'))**;

| **~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~**

Thanks again.

John

Building from source metadata-exiv2 branch fixed the problem.

I just run the AppImage. Glad it worked.

1 Like

Hi @JohnMoyer, welcome to Pixls!

Like Peter wrote, IBIS is unrelated to the raw crop. There’s no reason to touch those values.

The white level is there mainly to get rid of (most of the) color shifts in clipped highlights. Having too high of a white level typically results in magenta highlights. Set it too low and you lose details. You could measure the appropriate white level yourself, but if you have the time, submit white frame samples to get proper white levels added to RawTherapee.

The raw histogram in your screenshot looks normal, so there must be some adjustment causing the strange colors. The image size suggests the problematic image was taken with the 1.6 crop mode. Those images are not supported in version 5.9. All the clues (unsupported crop mode leading to black borders, random occurrence, good raw histogram, and colors resembling an inverted tone curve) point to a bad auto-matched tone curve. Check tone curve 1 in the exposure tool.

The current development version (and the Exiv2 version) support the 1.6 crop mode which means no black borders to confuse the auto-matched tone curve.

1 Like

Thanks!

I have compiled the Exiv2 version and it works as expected.

John

How do I know whether the needed samples have already been submitted or are still needed?

How does RawTherapee white level differ from the white levels reported by the camera?

Looking through recent photos, the white level reported by the camera is usually 13535, but I also see 12303 and 12735.

The specular white level usually reported by the camera is 14888, but I also see 14008 and 14351.

Would the metadat-exiv2 version of RT benefit from Adobe camera profiles?

Adobe DNG converter includes for my camera:

-rw-r–r-- 1 root wheel 278106 May 31 23:51 /Library/Application Support/Adobe/CameraRaw/CameraProfiles/Camera/Canon EOS R5/Canon EOS R5 Camera Faithful.dcp
-rw-r–r-- 1 root wheel 278108 May 31 23:51 /Library/Application Support/Adobe/CameraRaw/CameraProfiles/Camera/Canon EOS R5/Canon EOS R5 Camera Landscape.dcp
-rw-r–r-- 1 root wheel 278108 May 31 23:51 /Library/Application Support/Adobe/CameraRaw/CameraProfiles/Camera/Canon EOS R5/Canon EOS R5 Camera Monochrome.dcp
-rw-r–r-- 1 root wheel 278106 May 31 23:51 /Library/Application Support/Adobe/CameraRaw/CameraProfiles/Camera/Canon EOS R5/Canon EOS R5 Camera Neutral.dcp
-rw-r–r-- 1 root wheel 278106 May 31 23:51 /Library/Application Support/Adobe/CameraRaw/CameraProfiles/Camera/Canon EOS R5/Canon EOS R5 Camera Portrait.dcp
-rw-r–r-- 1 root wheel 278106 May 31 23:51 /Library/Application Support/Adobe/CameraRaw/CameraProfiles/Camera/Canon EOS R5/Canon EOS R5 Camera Standard.dcp

Thanks again.

John

Samples are submitted through the issue tracker. You can search for a particular camera there. For example, Issues · Beep6581/RawTherapee · GitHub doesn’t show any samples for the R5.

The methodology for measuring the white levels may be different. The RawTherapee way tries to maximize detail retention with a small margin to account for variations.

Those profiles provide a certain look for your photos. It’s your choice to use them or not.

1 Like

I made some white level files: Canon EOS R5 white level files · Issue #6783 · Beep6581/RawTherapee · GitHub