Set exposure module by absolute EV

First of all, hello to everyone, this is my first time posting. I’m an amateur photographer, open-source enthusiast and have been using dt for a while now. Really enjoying the AgX workflow!

The vast majority of the time, I take photos using my camera’s auto exposure modes, normally on aperture priority with auto shutter speed and iso, sometimes manual aperture and shutter but auto iso still. I find that this way of shooting provides a good straight out of camera jpeg for quick sharing and a good raw starting point for editing, all while taking little time to set up. This way I can focus on taking pictures of valuable moments without losing a shot while adjusting manual exposure.

However, I’ve had a problem with matching the exposure of photos in a series taken with auto exposure. By series I mean photos that are linked by their context, like a series of portraits, multiple angles of architecture or panorama frames. In these cases, it may be desirable to match the absolute exposure value of the photos so they look evenly exposed in their context.

This issue can be fixed right in camera by using manual exposure (duh) or pressing the AEL button, but many times I forget to do so in changing conditions. Darktable has a way of automating this process in a way through the area exposure mapping tab in the exposure module, however, this requires a consistent reference spot or object that may not always be in frame nor evenly illuminated for each photo in a series. It is also time consuming if the framing isn’t the same for each photo.

I’ve successfully used the exposure bias slider (the main slider of the exposure module) to match photos to a common absolute exposure. For example, if my reference exposure is set correctly on a photo with 1/1000 shutter and I want to adjust a photo with 1/2000 shutter to have the same EV, I simply add +1 EV to the second one. This is doable but tedious to do especially when dealing with series with varying f-numbers and iso.

I therefore propose the implementation of a method for automatically setting the absolute exposure value through the exposure module. I think this shouldn’t be hard to do given that the input image has shutter, iso, and f-number embedded in the metadata. I’m thinking it could be set either by EV number (for example, setting 14 EV for a sunlit subject) or by reference like in the area exposure mapping tab.

In my experience, matching EV this way isn’t perfect because camera settings don’t correlate 1:1 with actual light transmission, but it’s a good starting point and automating it would be a huge aid.

Lastly, I would try to implement this myself but I don’t have confidence in my coding skills. Could try though!

Hi and welcome! Seems like you’d want “compensate camera exposure” or “target level (automatic mode)” – both are detailed on this page darktable user manual - exposure

4 Likes

Welcome to pixls!

1 Like

Thanks. The “correct camera exposure” as I understand it reverts the in-camera exposure bias. I use it when trying to ETTR but it isn’t what I’m looking for. The automatic mode uses the pixel data of the picture and isn’t what I’m looking for either.

I’m looking for a tool or mode that would adjust the exposure based solely on the camera settings taken from the picture metadata, and an absolute exposure ‘EV100’ value, effectively adjusting the exposure bias to match the picture’s EV to the desired set point.

1 Like

I’d assume this is doable in Lua, that’s probably the best place to start.

If you want the feature added, you need to raise an issue at GitHub · Where software is built

1 Like

This is perhaps a naive question, but what combination of aperture, shutter speed, and ISO equals the absolute value EV100?

That doesn’t really matter…
Because you don’t want all images corrected to that EV anyway (it would correspond to exactly one combination of ISO, F-stop and shutter speed). So any combination could be used to define a base EV, as you are interested in differences in EV. (*)

What OP seems to want is correcting the exposure so all images have the same “brightness”. He wants that for a series of images with automatic exposure or manual exposure. That would correspond to taking a reference from one image, and adjust the others to look as if they were taken with the same combination of shutter, F-stop and ISO.

Of course, if the lighting conditions changed, that wouldn’t give the expected result…


*: one reason to define an absolute EV was the light meters of the period: they were separate from the camera, so having the meter yield a single value with lookup tables to get equivalent shutter/F-stop combinations for a given ISO (or DIN) value was a decent solution.

2 Likes

I am quite familiar with using old school meters, which is why I didn’t understand why an absolute reference value would be useful. For whatever reason, my brain did not interpret things as a wish to normalize the referent image to EV100 (or whatever).

Good luck on the project @gmr !

2 Likes

There is some merit in what the OP is asking for. The concept of Exposure Value is relatively old school and many younger photographers would not be familiar with it.

A sunny day has an EV of 15
Sunny day at beach is EV16
Sunny day in open shade EV12
A cloudy day EV12
A hazy day EV13

For the OP’s suggestion to work DT would need to calculate the the captured EV using the metadata for Aperture, Shutter, and ISO and then adjust the exposure module to output a desired EV value.

I actually like the idea, but a developer would need to get on board and create a LUA script or some other way of achieving this. The alternative would be for the OP to calculate this himself using the image information and then move the exposure slider the required EV value.

For many shots finding a similar tone or area of the image such as subject’s skin, patch of grass, item of clothing common between shots allows the area exposure mapping to do this for you. I have certainly used this method to match exposures prior to panorama stitching.

@wpferguson is this achievable in Lua and would it be something that you might consider?

2 Likes

I’m still not clear on what OP tries to do here:

  • does he want to correct for differences in metering in an otherwise constant scene (with modern camera metering, such difference can occur with changes in framing);
  • or does he want to correct for changes in ambient light (as he mentions “consistent reference spot or object that may not always be in frame nor evenly illuminated for each photo in a series.”)

The first case is easy enough (the needed metadata should be available, except for manual lenses). The second is hopeless for automation, as you cannot derive the amount of ambient light from the metatdata: you could still correct such that \frac{F^2}{t×S} is the same (see note) for a series of images, but that value changes when the ambient light changes…

Also, two of the subjects he mentions (architecture and panorama) usually give you enough time to take care of camera settings. Unless ligthing conditions are changing…


(Note: an actual correction should of course use the difference in \log_2(\frac{F^2}{t×S}) for the correction, where F = F-stop, t = shutter time, S is ISO value)

1 Like

it must be the first: autometering doesn’t necessarily come to the same EV-assumption with unchanged illumination since it just can measure reflections and not the light source. And if there aren’t any spots that can be used for the exposure matching tool, then those reflections can be quite different.
The only way is to reconstruct a reference EV based on ISO, aperture and exposure time and compare the similar calculated EV values for different picture taken using the same camera, lens, filters … under the same illumination. It’s irrelevant to know an exact EV, just the difference matters which can be calculated and exposure can be adjusted with this value.
So it’s like exposure matching based on metadata instead of the image.

Since metadata are accessible by lua scripts that should be possible …

4 Likes

By EV100 I mean exposure value at iso 100, I’ve seen it written like that before instead of simply EV.

Exactly! I want to use the camera metadata only.

I’m going to give it a try in lua when I have time.

1 Like

It’s something you can do manually (for a small sample) to see if the method actually works…
That can save you a lot of time once you start coding (and debugging).

1 Like

I made a small spread sheet to test the principle of it and it works easily enough. I guess it is a case of someone with the ability having enough interest to write a lua script. This idea works nicely when the EV of the scene is known such as a sunny day.

EDIT: I just used it on a series of images shot at fixed ISO in Aperture priority. The pictures were a series to be stitched together for a panorama but the shutter speed changed as the camera was rotated. This spreadsheet calculated the required position of the exposure slider to get matching images.

When I shoot multi image panos, I always shoot manually, and don’t change settings as I pan around; its so much easier in post.

2 Likes

Here’s the lua code to calculate the actual EV

local function calc_ev(aperture, shutter_speed)
  local ev = math.log((aperture ^ 2)/(shutter_speed), 2)
  return ev
end

local function actual_ev(aperture, shutter_speed, iso)
  return calc_ev(aperture, shutter_speed) - log((iso/100), 2)
end
1 Like