Magic Lantern Forum

Developing Magic Lantern => Feature Requests => Topic started by: trase on October 09, 2012, 06:21:46 PM

Title: [DONE] Aperture bracketing
Post by: trase on October 09, 2012, 06:21:46 PM
I would find aperture bracketing extremely useful.
I often shoot two consecutive pictures in Av mode, one with f1.8 and the next with f5.6. I later combine them, putting the sharp part of the f5.6 picture on the f1.8 one.
That way you can get images with optimum sharpness and yet with a nice soft background.
(The two pictures are of course both correctly exposed, unlike HDR bracketing)

The problem with doing it manually - that is changing the aperture using the scroll wheel, is of course both that it takes time between the shots and also that you inevitable move the camera a bit, making it more difficult to align the pictures.
Title: Re: Aperture bracketing
Post by: discocalculi on October 09, 2012, 07:46:52 PM
Sounds like an interesting feature.

I did a couple of image stacking tests using mirror lenses in order to get sharp tele pictures and have also tried a couple of shots with changing aperture on some manual lenses with some pretty interesting result.

What image software do you stack the images with?




Title: Re: Aperture bracketing
Post by: a1ex on October 09, 2012, 08:32:22 PM
You can try it here: https://bitbucket.org/hudson/magic-lantern/changeset/d64144418367
Title: Re: Aperture bracketing
Post by: trase on October 09, 2012, 09:18:39 PM
discocalculi: I usually just stack them manually in photoshop.
I align the sharp image as a layer on top of the one with the short DOF, and then using layer mask I paint out the sharp areas.

a1ex: wow, that was fast! I'm impressed, and appreciate your quick reply.
however - I'm afraid I haven't got a clue how to compile from source. I think I'm gonna have to wait and hope that it ends up in the next release - that would be so great.
Title: Re: Aperture bracketing
Post by: discocalculi on October 10, 2012, 02:46:20 AM
That was really fast, Alex!

Already tried tweaking some with the new exposure tricks and it seems promising. Aperture and exposure bracketing in combination with focus it would be a killer...

Trase: That's how I tried some stacking as well, but also tried it with Helicon Focus. Then there's Zerene stacker, which might come in handy.
Title: Re: Aperture bracketing
Post by: engardeknave on October 10, 2012, 02:52:22 AM
Quote from: trase on October 09, 2012, 06:21:46 PM
I often shoot two consecutive pictures in Av mode, one with f1.8 and the next with f5.6. I later combine them, putting the sharp part of the f5.6 picture on the f1.8 one.
That way you can get images with optimum sharpness and yet with a nice soft background.

I don't know how to compile from source either, but this sounds awesome. Can't wait to try it.
Title: Re: Aperture bracketing
Post by: discocalculi on October 10, 2012, 11:13:41 AM
I experimented some this morning just to get a hang of the bracketing. There are of course endless possibilities but I'm wondering if the aperture should affect the exposure in similar way as the shutter does?

I used Helicon Focus to stack a bunch of images ranging from f/1.4 to f/22. The result is painterly, but dull.

50mm f/1.4 http://imageshack.us/a/img138/4493/img9815acr.jpg (http://imageshack.us/a/img138/4493/img9815acr.jpg)
50mm f/22.0 http://imageshack.us/a/img89/9545/img9822acr.jpg (http://imageshack.us/a/img89/9545/img9822acr.jpg)

Helicon Focus (depth map)http://imageshack.us/a/img811/4339/focusresult2b88.jpg (http://imageshack.us/a/img811/4339/focusresult2b88.jpg)
Helicon Focus (weighted average) http://imageshack.us/a/img546/9328/focusresulta88.jpg (http://imageshack.us/a/img546/9328/focusresulta88.jpg)
Title: Re: Aperture bracketing
Post by: a1ex on October 10, 2012, 11:16:06 AM
From what I understand from here, exposure should be maintained.
http://en.wikipedia.org/wiki/Bracketing#Depth-of-field_bracketing

To change the exposure using aperture, simply run bracketing in Tv mode.
Title: Re: Aperture bracketing
Post by: discocalculi on October 10, 2012, 12:28:48 PM
Thanks for that article.

But I'm wondering if there's a possibility to see what happens if the aperture changes the exposure values as a extra feature and/or combined with shutter/iso?

Here's two manual examples with aperture and Shutter combined.

In the first example I went from a bright scene with a wide aperture, closing down the aperture and compensating somewhat with a slower shutter not to underexpose too quickly, gradually changing it into a dark scene. Merged in Photomatix.
http://imageshack.us/a/img9/7109/img9942and9moretonemapp.jpg (http://imageshack.us/a/img9/7109/img9942and9moretonemapp.jpg)

The other example i went from a pretty dark scene, with a wide aperture and fast shutter, slowly narrowing down the aperture and compensating with a slower shutter to gradually change it into a bright scene. Merged in Photomatix.
http://imageshack.us/a/img600/9576/img9931and10moretonemap.jpg (http://imageshack.us/a/img600/9576/img9931and10moretonemap.jpg)

And for reference normal DOF bracketing merged in Helicon Focus:
http://imageshack.us/a/img834/1378/focusresult3a88.jpg (http://imageshack.us/a/img834/1378/focusresult3a88.jpg)

Exposure (Tv) bracketing with shutter and iso changes, aperture stuck at f/1.4. Merged in Photomatix:
http://imageshack.us/a/img100/6192/img9922345678tonemapped.jpg (http://imageshack.us/a/img100/6192/img9922345678tonemapped.jpg)

At f/1.4
http://imageshack.us/a/img834/3776/img9904acr.jpg (http://imageshack.us/a/img834/3776/img9904acr.jpg)
At f/22
http://imageshack.us/a/img685/7884/img9912acr.jpg (http://imageshack.us/a/img685/7884/img9912acr.jpg)

[Edit]
Another example, this one running from bright with a narrow aperture, slowly opening up the aperture and also also adjusting shutter speeds not to overexpose but rather to darken the image:
http://imageshack.us/a/img713/2672/img9969and8moretonemapp.jpg (http://imageshack.us/a/img713/2672/img9969and8moretonemapp.jpg)


Also notice how fake photomatix images tend to look.


Title: Re: Aperture bracketing
Post by: a1ex on October 10, 2012, 12:58:25 PM
Got it, but it's a bit hard to do without complicating the menu (would require a setting for aperture step and another for exposure step). And if you don't overexpose, should be easy to do in post.
Title: Re: Aperture bracketing
Post by: discocalculi on October 10, 2012, 01:10:15 PM
I fully agree. It would make things difficult and the problem with manual lenses is still there. As of now HDR bracketing still works with manual lenses without having to change the aperture (shutter and iso only). Adding DOF to HDR bracketing complicates things, but it sure looks pretty interesting... Combined with White balance bracketing and focus stacking, one would get a very powerful bracketing tool.
Title: Re: Aperture bracketing
Post by: a1ex on October 10, 2012, 01:12:06 PM
I don't see the point for WB bracketing - just shoot raw.

Focus bracketing can already be combined with expo/DOF bracketing.
Title: Re: Aperture bracketing
Post by: discocalculi on October 10, 2012, 01:28:28 PM
Ah. That's excellent! Havn't run Bracketing and Focus stacking at the same time.

From what I've learned faulty white balance can be tricky at times to save in post processing. Especially pink/purple flowers tend to overexpose quickly in post production for some weird reason. Might be that Adobe Camera Raw dont handle it too well or due the general curves are not symmetrical. I'm not sure if one would benefit from multiple exposures in such a case.

Title: Re: Aperture bracketing
Post by: a1ex on October 10, 2012, 01:31:57 PM
That's probably one of the channels being clipped. You can use RGB histogram (which may force you to underexpose by 1 stop), or UniWB.
Title: Re: Aperture bracketing
Post by: trase on October 10, 2012, 05:01:13 PM
yes, exposure should be maintained.
here's an example (view at 100%):
(http://www.freeimagehosting.net/t/copjd.jpg) (http://www.freeimagehosting.net/copjd)

as you can see - at f1.8 the background blur is nice, but even the subject isn't very sharp.
at f5.6 sharpness is good, but background is very busy.
combined, you get the best of both worlds.

discocalculi: nice too see your experimentation. helicon focus and zerene stacker is something I might look into. however, for this purpose (stacking only two images), I find doing it manually works well and gives complete control of the result.
Title: Re: Aperture bracketing
Post by: ilguercio on October 10, 2012, 05:11:08 PM
Nice stuff, never thought about this.
Title: Re: Aperture bracketing
Post by: Digital Guy on October 10, 2012, 06:30:49 PM
Interested? Hell yea.. where do I click?
Title: Re: Aperture bracketing
Post by: engardeknave on October 11, 2012, 06:40:22 AM
Ok, I sent my bribe (eatyummypuppies at gmail). Can I get a compiled version?
Title: Re: Aperture bracketing
Post by: a1ex on October 11, 2012, 07:46:54 AM
We'll try to implement nightly builds (just be aware that they might be completely untested, unlike stable releases where I usually spend weeks trying every single feature).
Title: Re: Aperture bracketing
Post by: nanomad on October 11, 2012, 10:39:04 AM
I'm working on that right now ::)
Title: Re: Aperture bracketing
Post by: bart on October 11, 2012, 11:34:46 AM
Quote from: trase on October 10, 2012, 05:01:13 PM
I find doing it manually works well and gives complete control of the result.

And how do you do this manually? As sharper details like to moss tops take less space then blurred details. What do you do with the edges. Does this involve some serious photoshop editing and precise skills on how things still  look natural?
Title: Re: Aperture bracketing
Post by: a1ex on October 11, 2012, 01:24:02 PM
Quote from: nanomad on October 11, 2012, 10:39:04 AM
I'm working on that right now ::)

Nanomad did a great job, so you should be able to try this here:

http://nanomad.magiclantern.fm/nightly/

disclaimer: I was too lazy to try it :P
Title: Re: Aperture bracketing
Post by: engardeknave on October 11, 2012, 06:36:47 PM
Quote from: b4rt on October 11, 2012, 11:34:46 AM
And how do you do this manually? As sharper details like to moss tops take less space then blurred details. What do you do with the edges. Does this involve some serious photoshop editing and precise skills on how things still  look natural?

No, it looks pretty easy. Just put the photos on top of each other as layers and mask the areas you don't want to see from the top one (or simply erase). Use a brush with no hardness to blend at the edges.
Title: Re: [DONE] Aperture bracketing
Post by: trase on October 11, 2012, 07:17:46 PM
This is great - I'm very impressed and thankful that you implemented this feature so quickly.
I have tried it out now and it works very well.
Thanks a1ex, good job!
Thanks also to nanomad for the nightly.

Now, this may seem like nitpicking but it might be preferable in this case if you could choose the sequence " - 0 " . For example, when shooting a portrait it would be better if the shot with the shortest shutter time would be taken first, to minimize the risk of the model moving between the shots. A minor detail for sure, but worth considering.

engardeknave: That's right, however:

b4rt: That's a correct observation. You have to use your artistic sense. - sometimes it's better to leave the edges from the blurry image to have a smooth transition, and sometimes it works very well to mask a few pixels outside of the edge. In that case, you will get a part of the sharp image where it 'shouldn't be', but oftentimes that is not visible.
I find it quite easy to get good results quickly.
The merging is of course easiest with pictures such as portraits where you have a single sharp object against a blurred background.
Title: Re: [DONE] Aperture bracketing
Post by: a1ex on October 11, 2012, 07:25:56 PM
First shot has to be 0 - that's a limitation. You take the first shot (with Canon settings), ML figures out that you took a picture and continues from there.

But you can select 0++.
Title: Re: [DONE] Aperture bracketing
Post by: trase on October 11, 2012, 08:23:59 PM
Ah, yes, 0++
That makes it work exactly like I want it too. Thanks for pointing that out!
Title: Re: Aperture bracketing
Post by: scrax on October 15, 2012, 10:50:42 AM
Quote from: trase on October 10, 2012, 05:01:13 PM
yes, exposure should be maintained.
here's an example (view at 100%):
(http://www.freeimagehosting.net/t/copjd.jpg) (http://www.freeimagehosting.net/copjd)

as you can see - at f1.8 the background blur is nice, but even the subject isn't very sharp.
at f5.6 sharpness is good, but background is very busy.
combined, you get the best of both worlds.

I don't understand the purpose of this, from the example posted to me looks like that at f1.8 the mushroom isn't very sharp because focus point is not on it but a little behind (on the pine needles).
And why can't you take a shot at f2,8 instead?
I think there is something i misunderstood about when to use this technique.
Is a way to have more control on what to have blurred? If so why not shooting one pic at f1.8 and the other at f22 or more?
Or maybe better to have also an intermediate value that usually is the best detailed aperture of the lens.

For example my EF 100mm f/2.8 USM Macro can go to f32 so for this lens my ideal best aperture value are:
f2.8 (max blur),
f9.0 (max details),
f32 (max sharpness)

merging them manually will give me the advantage to chose were to have blur, detail and sharpness on the final image, am I right now?
Title: Re: [DONE] Aperture bracketing
Post by: trase on October 15, 2012, 06:39:23 PM
I use the method to get an image with the subject at maximum sharpness and yet with maximum amount of background blur.

The mushroom in the first picture isn't very sharp because the lens isn't very sharp at f1.8, even when the focus point is spot on.

As you probably know, almost no lens is optimally sharp at its widest aperture. Not only are they not optimally sharp, defects such as chromatic aberration are also more pronounced.
Neither are they optimally sharp at very small apertures such as f22 or more, due to diffraction. (They do of course give the farthest DOF, but that is not really important in this case).
Most lenses are sharpest somewhere around f5.6 - f8.0 (as a rule of thumb, this may be debated forever).

Taking the shot at f2.8 as you suggest would surely be a nice compromise, and useful for most situations, however it would neither give most background blur nor most sharpness.

Therefore I find the best way to achieve this is to merge a wide open shot with one at the lens' sharpest aperture.

You can see the effect more clearly here:
http://www.magiclantern.fm/forum/index.php?topic=3113.0

Edit: By the way I didn't mean to sound so lecturing, I just tried to explain it as clearly as possible to anyone reading this who may wonder the same thing as you.
Title: Re: [DONE] Aperture bracketing
Post by: ilguercio on October 15, 2012, 07:39:25 PM
These are the test results of a copy of Canon 100 macro 2.8
(http://www.photozone.de/images/8Reviews/lenses/canon_100_28_50d/mtf.png)
As you can see, f/5.6 is usually the f value at which lenses perform the best, if it is not their largest aperture already.
F/32 is surely not the sharpest, probably the least sharp of them all.
Title: Re: [DONE] Aperture bracketing
Post by: scrax on October 15, 2012, 08:57:22 PM
Yes that was what i was meaning with the 3 shot f2.8 f9 f32.
I'm agree that f5,6 or f4 looks the better resolution/detail.
So the technique is to use f5,6 for the subject and then f2.8 for having a more real blur (than for example blurring it with photoshop) in the background than with f5,6.
Title: Re: [DONE] Aperture bracketing
Post by: trase on October 15, 2012, 10:42:02 PM
That's right. A combination of one shot wide open with one at the lens' sharpest aperture.
A lens capable of really short DOF will give the most worthwhile result.
Title: Re: [DONE] Aperture bracketing
Post by: indojepang on November 17, 2012, 11:21:10 PM
isn't it photoshop has photomerge function? why you do it manually?
http://www.youtube.com/watch?v=intzev1gsbI (http://www.youtube.com/watch?v=intzev1gsbI)
Title: Re: [DONE] Aperture bracketing
Post by: trase on November 18, 2012, 09:06:00 PM
Yes there are surely many ways to combine the images, both manually and automatically.
I haven't tried to use photoshops photomerge function for it.

For now, I personally like doing it manually, it gives the control I want.
Title: Re: [DONE] Aperture bracketing
Post by: kaos42ze on April 11, 2014, 08:37:19 PM
where can i find this feature, i am on the latest nightly build
Title: Re: [DONE] Aperture bracketing
Post by: dmilligan on April 11, 2014, 11:48:41 PM
Shoot > Advanced Bracket > Bracket Type > DOF (Aperture)
Title: Re: [DONE] Aperture bracketing
Post by: kaos42ze on April 23, 2014, 07:16:11 AM
ohhh yeah ... i found it now, how can i make it take 2 pictures ( one at f/2.0 and one at f/11 ) ... i tried settings with different EVs different number of shots and it either takes pictures non stop or takes pictures at the same aperture.
Title: Re: [DONE] Aperture bracketing
Post by: barepixels on July 28, 2014, 10:12:27 AM
Is this by design or a bug

In Advance Bracket I have

Bracket Type: DOF (Aperture)
Frame: 3
EV increment: 2EV
Sequence: 0- --
2 Second Delay OFF
ISO Shifting: OFF

So.... when Sequence are

24-70mm 2.8
==========================
0- --               I get  2.8 - 5.6 - 11
0- + -- ++      I get  2.8 - 5.6 - 2.8
0+ ++            I get  2.8 - 2.8 - 2.8   
Title: Re: [DONE] Aperture bracketing
Post by: a1ex on July 28, 2014, 10:14:06 AM
Can your lens go wider than f2.8?
Title: Re: [DONE] Aperture bracketing
Post by: barepixels on July 28, 2014, 06:10:44 PM
again same settings

Bracket Type: DOF (Aperture)
Frame: 3
EV increment: 2EV
Sequence: 0- --
2 Second Delay OFF
ISO Shifting: OFF

50mm 1.4
0- --               I get  1.4 - 2.8 - 5.6
0- + -- ++      I get  1.4 - 5.6 - 1.4
0+ ++            I get  1.4 - 1.4 - 1.4   
==========================
85mm 1.2
0- --               I get  1.2 - 2.5 - 5.0  <-- very cool I never seen 2.5 and 5.0 before
0- + -- ++      I get  1.2 - 2.5- 1.2
0+ ++            I get  1.2 - 1.2 - 1.2   
Title: Re: [DONE] Aperture bracketing
Post by: a1ex on July 28, 2014, 06:17:00 PM
Looks OK to me.

The "very cool" trick may be a problem on some cameras (like 60D), need to check.
Title: Re: [DONE] Aperture bracketing
Post by: fav on December 28, 2021, 03:59:30 PM
Hi, sorry for posting in this very old topic ^^
I've used a lot ML on my 7D back in the days and few days back i was talking with a friend about a great feature that he wanted to have, "Aperture bracketing". And i said, if i remember well i think that was possible on ML !

I would like to know if it' possible to edit some settings in the code, like the EV Incriment and the Sequence ?
Thanks

ps: happy christmas and end of year to everybody :)
Title: Re: [DONE] Aperture bracketing
Post by: Walter Schulz on January 13, 2022, 01:02:53 PM
Sorry, please clarify: What is your actual question?
Maybe have a look into https://wiki.magiclantern.fm/camera_help#advanced_bracket