Dynamic processing profiles for RawTherapee

Hi all,
in the last couple of weeks I’ve been working on a new feature for RawTherapee, that I called “dynamic processing profiles”. Essentially, this is a sort of built-in version of what can be done already with the custom profile builder. The idea is that you can define some rules (based on the EXIF metadata of the picture, like camera name, ISO, etc.) for automatically applying some (partial) processing profiles the first time you edit a picture with RT.

I’ve added a new mode, “(Dynamic)”, to the “Default Processing Profile” option (in the “Image Processing” tab of the preferences dialog), which activates the functionality.
Then, you need to define your custom rules. This is done again via the preferences dialog, under the new tab “Dynamic Profile Rules”. Here’s a screenshot:

When you edit a picture for the first time, the list of rules is scanned, and all the profiles that match are combined (in the order given, so later rules can override earlier ones) to build the initial .pp3 file.

Before submitting a pull request for inclusion in the official RT, I’d like to collect some feedback from the community. There are still some rough edges and some (minor) features missing, but most of what I had in mind is there. If you are willing to help testing, the code is at https://github.com/agriggio/RawTherapee, in the dynamicprofile branch.

11 Likes

This sounds like an interesting idea to me!
:+1:

Like it. :+1:

A compiled test version for Windows (x64. Gtk3.22) can be downloaded from here:
https://filebin.net/3jlkdz4175j2sy3r

No installer included. Extract the folder “RawTherapee_dynamicprofile” to e.g. your Desktop and run “rawtherapee.exe” inside this folder.
Cache and settings are saved into localappdata\Rawtherapee-dynamicprofile”. It leaves your current installation untouched.

1 Like

I just compiled your branch successfully on Linux.

I tried it with raws from 2 cameras (FUJIFILM X-T1 and X-T2) and I just tried to apply the BW1 bundled profile to any raw file (rules set to their default, camera names as retrieved form ExifInfo).

I made sure to delete previous .pp3’s and the .cache/.config folders from previous installs, but it didn’t apply the specified profile. Any idea? You can download one of my raw files here: Filebin | a07if81neuklvq0o (public domain license CC0)

A question: how is the the shutter speed rule specified? If 1000 means “1/1000sec”, then you need to allow for higher limit. If 1000 means “1000 seconds”, then to specify faster shutter speed like “1/1000sec” which is 0.001 second you need to allow for more decimals for the minimum.

Hi @sguyader, and thanks for the feedback!

Works here… Are you sure you selected “(Dynamic)” as the default processing profile for raw photos (Preferences → Image Processing)? That is required to activate the new behaviour.

Edit: here’s a screenshot to clarify

Indeed, the values are in seconds. But I see that I set too few decimals (that’s one of the rough edges I mentioned above :slight_smile:). I’ll fix that. In fact, I’d like to implement a better UI for this (copying from Darktable probably)

Ah… That was it, sorry! Works fine, it’s a very useful addition in my opinion.

Found an issue with the values.

The Shutter column shows only one decimal.

All decimals are set to “0” after closing and opening the preferences again

The values are correctly saved in the file dynamicprofile.cfg

[entry 4]
iso_min=800
iso_max=512000
fnumber_min=5.5999999999999996
fnumber_max=100
focallen_min=20.300000000000001
focallen_max=10000
shutterspeed_min=0.059999999999999998
shutterspeed_max=1000
expcomp_min=-19.199999999999999
expcomp_max=20
camera_enabled=true
camera_value=NIKON COOLPIX P330
lens_enabled=false
lens_value=
profilepath=${U}\\(Auto-Profiles)\\P330 - Starkes Rauschen

Thanks, I’ll investigate asap!

Wow! This is great! I haven’t actually tested it, but I think it’s a great idea to have the selection of profiles based on EXIF built into RawTherapee. One question though (without looking at the code): do you only have access to those parameters you listed on the “Edit Dynamic Profile Rule” dialogue? I ask this because my reason for writing RTProfileSelector (a custom profile builder) over a couple of years ago was to have my monochrome photos shown as black & white upon opening them in RT. I had to use Exiftool, as the key file provided by RawTherapee at the time didn’t have the camera-model-specific key I needed to select my black & white .pp3 file (in my case, the “Photo Style=Monochrome” for the Panasonic GM1). So, if you do have access to a wider range of EXIF keys than currently show in the edit rule dialogue, it might be a good idea to present them in a grid-like control, with a check-box for each entry and maybe some sort of interpreter of simple logical statements (=, <, >) for the values.

3 Likes

Hi @MarcosC, thanks for the feedback!
I think your idea makes sense, but I’m not sure I will implement it :slight_smile:
Let me elaborate.

My intention for the dynamic profile editor was not to replace the custom profile builder (at least in the short term), but rather to provide a simple alternative/complement to it, that covers the common cases (e.g. load the proper camera and lens profile automatically, activate your preferred noise reduction settings given the ISO value, etc.).

For more advanced use cases, IMHO the custom profile builder is the way to go. Even if I implemented your proposed feature (definitely feasible, but a bit time consuming, especially if a custom DSL is also needed - even if simple), it would still not be general enough. Despite the name, the dynamic profile editor offers a rather limited dynamism: it only allows to combine statically-defined profiles. With a custom profile builder, you can generate the profiles on the fly, and I can imagine some advanced users wanting this.

So, my proposal would be to keep the built-in dynamic profile editor the way it is, which IMHO offers a good compromise between simplicity and flexibility, but instead make it possible to combine it with the custom profile builder. The idea would be that you define the rules for the “normal” settings, and then use a custom profile builder for the fine-tuning/more advanced stuff.

How does that sound?
(involving also @heckflosse who requested basically the same feature on github)

3 Likes

Ok, I understand it. :slight_smile: Maybe one day, after the Dynamic Profile feature make it into RawTherapee, it could be further improved as per my suggestion. Don’t get me wrong: as I said, I think it’s a great idea, and would certainly cover the needs of most users. It’s only that I had hopes that such a feature could completely replace RTProfileSelector, with a a number of advantages (being integrated into the UI). Something I’ve been asked to do is write some sort of GUI tool to manage RTProfileSelector’s rules, but I can never find the time for that…

2 Likes

Indeed this is a great idea! Please let me know when you think it’s a good time to write up a post about it!

Thanks @patdavid! The code is under review by the core RT developers (who are suggesting some tweaks here and there to make it nicer), hopefully it should be merged in a few days…

available in RT dev branch now!

Where are the development branches again? I’ve lost that link.
Thanks

If @paperdigits is game, would you be willing to coordinate with him to write up an article describing what the dynamic profiles do, and how folks could leverage it (when it hits stable)?

1 Like

I’m game!

3 Likes

Sure, I’m happy to help! Just let me know how (but don’t expect super-fast response times :slight_smile: )

1 Like

I will write up an article based on my understanding and have you all fact check it.

2 Likes