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.
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.
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.
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
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.