How to batch process raw images - auto tuning levels per image when applying styles

Hello! Moved from Photoshops raw editor to Darktable, and I love it so far.
In my work I need to sometimes process 100s of pictures a day, and it’s mostly just a task of overblowing the background to white (Shot on a product table with light underneath for pure white background) and setting the white balance automatically.
Playing around, I found that styles would be a nice way to automate it.
The style includes:

  • lens correction
  • denoise (profiled)
  • exposure
  • highlight reconstruction
  • filmic rgb
  • few more…

All of them work fine but the filmic RGB. Clicking Auto tune levels, selecting the whole image, then setting a contrast under the look tab seems like all I need. But then applying the style to multiple photos, I noticed that it applies those levels to all images, instead of auto tuning levels for all images separately. Is there a way around this?
I want to go from left-side half to right-side half

Another problem I would like to ask for a solution for is, that when I crop digitally in while shooting in camera, the camera remembers the cropped area but still saves the full image. Photoshop showed this via a border I could easily crop to or having a setting of either “as shot” or “original”, where as shot would keep the aspect ratio I wanted to shot at and any potential zooms, but I couldn’t find a way inside Darktable to commit to that crop. Doing that with a style would also be great.

If all this was possible with styles, I could just apply a single style to a folder via the CLI and have ready pictures super easily!

Example image attached(digital crop for desired aspect ratio should be included), I’d be grateful for any tips <3
P1011321.RW2 (34.4 MB)
cheers, dj

1 Like

Not sure about the crop but the first issue and maybe a couple of others you can address by using a feature of this…


You have asked a couple of interesting questions here and I look forward to seeing the replies from more experinced and knowledgeable people than me.

When I consider your problem I have to hope (presume) you have a consistent lighting set up and consistent exposure in camera and therefore the images will process with much the same parameters settings in filmic. If this is the case then what I am suggesting may work, but I am not sure if it is any different in its actions to creating a style. I would process the first image until it looked good. Then I would use the keyboard ctrl+shift+C and select the parts to copy. Then select another image from the shoot and use ctrl+V to post the same adjustments across. This process has worked well for me in the past.

This is an instance where a color chercker would help a lot! Then use the feature in color calibration.

Shoot a new photo of the color checker every time you change the lighting.

" Clicking Auto tune levels , selecting the whole image, then setting a contrast under the look tab seems like all I need."

It would seem he is asking how to run auto levels in filmic for each image… this is one feature of the initial workflow script I mentioned… As for the contrast that would have to be similar as there is no dynamic way to set that in filmic…

1 Like

Yes I think the answer to the first part of his question - batch auto tuning filmic levels - would be done via lua script. I’m not terribly familiar with lua though, so can’t give clear advice how to do that.

You don’t need to know… all the work has been done… this amazing little script is highly flexible and offers lots of ways to tweak some of the main initial settings … it provides a new module that you can run on one image or a batch…



There is a topic for the initial workflow script:

Read also

And the one below it.

You will need to install git:


This script is nifty, I checked it out but to me it looks like it relies on the gui and is incredibly slow I can see it crawing across my screen like a mouse. I’d prefer a solution where I can do all of this with the CLI.

Been thinking of getting one! It would be great for keeping my colors in check, but whilst my lighting is always the same, my camera angle isn’t. My lighting setup has a hotspot on the table, which is visible in the raw image. If I place something differently, the light spot will also be elsewhere, so I can’t rely on it’s brightness etc.

That is what I tried initially, and it does work on some as the lighting is the same, but sometimes I have to shoot very reflective or quite light colored objects, which got blown out after I applied a “common style”. Applying the style and clicking “auto tune levels” again on it fixed it. So it’s not as easy as that, but it’s so close I’m sure there’s a way to make it work :slight_smile:

You could assign hotkeys to operations. Those can also speed up operating darktable.

1 Like

hotkeys doesn’t work with darktable-cli :wink:

1 Like

the commandline applies a set of parameters baked in in the style or xmp you apply. If no parameters are saved then the defaults (calculated from image properties for filmicrgb) are applied.
You might try to use darktable 4.4 user manual - using darktable from a lua script and batch run the gui :wink:

Any solutions for this? I haven’t found a way, and just realized that even if I set my camera to 4:3, it still saves at it’s native ratio and saves it only as a hint, same way as mentioned above.

Best way I found is to apply to the style also a crop

As for the darkness, I managed to find settings that work for almost all pictures generally, so I guess that’s not much of an issue now

If this is a CR3 file, its a bug and it’ll be fixed in the next release.

It’s an RW2 file, from a Lumix S5. Example image attached to original post