Focus Stacking with Open Camera (a Recipe)

  1. Bouncer71
    OnePlus 7 Pro Sample Shot Photographer Nov 26, 2018

    Bouncer71 , Nov 26, 2018 :
    Hello Friends and Photo Maniacs,

    at times when you shoot Photos, especially macros, don´t you wish there would be a larger depth of field. If you get real close only a small part of the picture is in focus and the rest is blurred. The problem is that's how optics work. Not everything can be in total focus…
    Like this... ;D


    Look over your phone at something more distant and the device will blur before your eyes… ;D
    Plus the fact that your smartphone camera has a wide aperture which also has an effect on the depth of field...

    Well, no need to hesitate, there's a solution called Focus Stacking.
    Blending multiple Photos with different focus points into one super focused Picture..

    It's not some instant mode in camera, it needs post processing but i promise you it won't be that difficult… It's actually pretty easy…

    Most of the times ; )

    What do we need…?

    First of all a Tripod or a really stable position cause you don't want too much movement of the camera.

    Secondly Open Camera
    @mdwh added the really cool Focus Stacking to the App…
    I guess you didn't know that the creator of Open Camera is a community member…
    (Though he hasn't been active for some time)

    And finally the software to blend the pics…
    PicoLay (Freeware), Photoshop,...

    So let's begin cooking up a pic…

    Configuring Open Camera

    Open the app, tab on the gear icon, scroll all the way down and activate CameraAPI 2...


    Now restart…

    Tab on the 3 dots...


    Select FOCUS { },

    At “Amount of photos” you can set how many brackets will be shot (12) and below you can add an extra shot for infinity (unendlich)…
    Didn't find a way to change the language to English ;D
    The amount of brackets can be up to 20. I personally tried it and the maximum with a significant difference in focus on my OP3 and 3T was 14…
    Everything above just results in longer processing time and unsatisfying outcomes…
    If you find or know a scene where it works perfectly go ahead and comment… ;D

    Tab on the gear again to get you back…


    Now there's two overlays..
    The bottom is for the closest focus and the one above for the farthest focus…
    While you pull you can see the focus area move…
    It doesn't go below 10 cm so the subject shouldn't be closer to the lens…
    Set both values to the desired values…
    But take in count that a picture where everything is in total focus can look unnatural…
    So keep a little blurriness… ;D

    Setting up the Scene

    I will just continue with the example I've set up in my kitchen…

    Remember the tripod I mentioned…?


    Closest focus point set to 10 cm…


    Farthest pulled till the edge of the potato is sharp…


    Now tap the trigger…
    It will take a couple of seconds for the shooting to finish. The preview pic in the upper right corner will start to blink when the files are written to the phone…

    This scene would've probably been possible to do with 6 to 8 shots, but I needed some more to show something concerning PicoLay later on…

    So here are the 12 shots..
    as a gif….


    You can see how the focus moves from front to back and the lens distortion effect...
    Now we´re done on camera let´s continue with some fun post... ;D

    Stacking with PicoLay

    Transfer the photos to the PC..
    Start the Program, Click File -> Add Images -> select the files...

    Screenshot (42).jpg

    You will see that PicoLay will not sort the files in the proper order…
    _10 will be listed after _1…

    We don't want that cause of misinterpretation in processing…
    I renamed the files to _x10, _x11…

    Screenshot (43).jpg

    Now they are in perfect order… ;D
    Next click on “Stack operations” and select “Set stacking parameters…
    Select “Smart Filter”, “Align images 2x” (because of the lense distortion)...
    Auto enhance adds a little contrast and saturation if you want… ;D

    Screenshot (44).jpg

    Click GO…
    Again you will have to wait a couple of seconds till the magic is done…

    Screenshot (45).jpg

    Looking at the depth map probably 5 photos would've been enough…;D
    Here's the outcome….


    and the first pic again for comparison where only just the teeth of the skull were in focus...


    Okay, there you have it…

    Now on to the next Chapter...

    Dealing with Movement
    Added 28.11.2018

    What about shooting photos out in the wild where things aren't always static…?
    Like shooting marcos of a flower that shakes at the slightest sign of air movement...

    I can say PicoLay has some problems dealing with that…
    But let's see the scene first…
    Shot with a 12,5x Macro Lens.



    As you can see the depth of field is very narrow, a couple of mm at most and there's no way to get all parts in focus in a single shot… Don't even think about getting the background crystal clear…
    It would ruin the effect...It is impossible because of the macro lens anyways ;D

    I set up this shot with 10 focus points…


    Though using a tripod there's a lot of movement. You just can't control everything.. ;D
    And this is the result with PicoLay...


    The artifacts are pretty obvious…
    Well, it's Freeware and for stills it does an amazing job…!

    For this we need something like Photoshop..
    And here we go…

    Focus stacking with Photoshop

    Fire it up and go to File-> Script -> Stack Files

    Screenshot (55).jpg

    Load the Photos…
    Select all the Layers on the bottom right with a Shift click.

    Screenshot (56).jpg

    Goto Edit-> Autoalign Layers

    Screenshot (57).jpg

    And now guess what…?
    Click OK would be the right answer… ;D

    Next: Edit-> Auto Blend Layers

    Screenshot (58).jpg

    I guess we don't want a panorama, do we… ;D

    Screenshot (59).jpg

    This will take some time to process….

    Screenshot (60).jpg

    Way better, isn't it…?
    In the Layers Tab you can see the layer masks Photoshop created. Click on the eye to next to the layer just for fun… ;D

    We're almost done…
    Reduce to background layer, crop and save or export…


    Do you see any blending errors…?
    I don't…
    And still enough blurriness to preserve that natural look... 8D

    So that's it for this Tutorial. If I find more apps, programs or other ways of doing Focus Stacking I will add it…

    If you do, please comment...

    Hope you enjoyed it…!
    And now….

    Go out there and stack some focus…

    Or focus on stacks…?
    Well, at least have fun and I would be very happy to see some of your work…! 8D
    Will probably be way better than mine… ;D

    P.s.: All Photos shot with OnePlus 3 and 3T...
    Last edited: Nov 28, 2018

  2. meatandy
    Oreo Nov 26, 2018

    meatandy , Nov 26, 2018 :
    Wow , That is really a neat focal explanation and utilization of a potato.:p

  3. toastytoast1234
    Marshmallow Nov 26, 2018

    toastytoast1234 , Nov 26, 2018 :
    Great informative post, but can I just ask what's going on with the skull, the potato, and the Chinatown (?) gate-entrance-thing?

    Was that just a random selection of objects you just happened to have laying around, or is there some deeper cultural significance I'm missing out on?

    xnutzii, otto2, buntycubal and 3 others like this.
  4. Bouncer71
    OnePlus 7 Pro Sample Shot Photographer Nov 26, 2018

    Bouncer71 , Nov 26, 2018 :
    Well, thank you... 8D

    And thank you too...!

    Just random decorative things catching dust around the house...
    Except for the potato which played an important role in a tasty soup that evening... ;D

    After all...
    Potatos seem to be the THING* since you know when... ;D

    *Just laying around in the Kitchen so....

    xnutzii, script, otto2 and 4 others like this.
  5. toastytoast1234
    Marshmallow Nov 26, 2018

    toastytoast1234 , Nov 26, 2018 :
    Would have been at least 200% better with some fajitas instead, but still a great post.

    I'll never do any of it, but I'm sure many people will.

    xnutzii, otto2, buntycubal and 2 others like this.
  6. Bouncer71
    OnePlus 7 Pro Sample Shot Photographer Nov 26, 2018

    Bouncer71 , Nov 26, 2018 :
    I don't get any good around here ... 8(

    How about some Jägermeister...? ;D


    Thanks a lot again...! 8D

    TibiTibi, xnutzii, otto2 and 3 others like this.
  7. meatandy
    Oreo Nov 27, 2018

    meatandy , Nov 27, 2018 :
    Wait , you shot all these clicks on the op3?

  8. toastytoast1234
    Marshmallow Nov 27, 2018

    toastytoast1234 , Nov 27, 2018 :
    Wait, you're calling them clicks now? Is that a thing?

    xnutzii, otto2 and Bouncer71 like this.
  9. meatandy
    Oreo Nov 27, 2018

    meatandy , Nov 27, 2018 :
    Pretty sure the term clicks is out of style now ,
    But that does not bother me .

  10. toastytoast1234
    Marshmallow Nov 27, 2018

    toastytoast1234 , Nov 27, 2018 :
    Well if you can walk around with a haircut from the 1920s I suppose everything else just blows right over you.

  11. buntycubal
    Marshmallow Nov 27, 2018

    buntycubal , Nov 27, 2018 :
    Great Tutorial , Very Informative , Thank You... this should be pinned in photography section...

    xnutzii, otto2, script and 2 others like this.
  12. B_Wrath
    Marshmallow Nov 27, 2018

    xnutzii, otto2, meatandy and 2 others like this.
  13. Bouncer71
    OnePlus 7 Pro Sample Shot Photographer Nov 27, 2018

    Bouncer71 , Nov 27, 2018 :
    Yep and nope..

    The potato scene with the OP3T, the flower stack and tripod pic with the OP3... ;D

    Thanks a ton.. ! 8D
    Glad you like it.. !!!

    xnutzii, otto2, meatandy and 2 others like this.
  14. otto2
    Lollipop Nov 27, 2018

    otto2 , Nov 27, 2018 :
    Killepitsch! I ll spend a bottle of... But be aware of @Adam Krisko and @David Y. - they will go for it ...

    The potatoe is to be sold separetely for 1.2 million dollars, so Kevin Abosh will loose his record. ;)

  15. Bouncer71
    OnePlus 7 Pro Sample Shot Photographer Nov 27, 2018

    Bouncer71 , Nov 27, 2018 :
    Couldn't we share the bottle and have a crazy party to remember...? ;D

    oh man...
    The potato is already gone...
    Kartoffelsuppe mit Wursteinlage... 8P

    It's tastier than Fame anyways... 8D

    xnutzii, otto2 and script like this.
  16. script
    Nougat Moderator Nov 27, 2018

    script , Nov 27, 2018 :
    Great. I will feature it ofc. You can count on that this time:)

    xnutzii, otto2 and Bouncer71 like this.
  17. YRJ
    Lollipop Nov 27, 2018

    YRJ , Nov 27, 2018 :
    Woohoo! continuing the tradition @Bouncer71 another great thread! [e]1f60a[/e] informative and we'll composed.
    I can be sure it is going to be a quality thread if it comes from you or @NeVeR_SeTTLe keep up the good work! [e]1f609[/e]

    xnutzii, otto2 and Bouncer71 like this.
  18. Bouncer71
    OnePlus 7 Pro Sample Shot Photographer Nov 27, 2018

    Bouncer71 , Nov 27, 2018 :
    Thanks my friend... 8D
    I know you will and I really appreciate it...!!! ;D

    Thanks so much for the nice words mate.. 8D

    I guess we'll try...

    Still some subjects left we can write about... ;D
    I think... o_0

    xnutzii, YRJ, otto2 and 1 other person like this.
  19. otto2
    Lollipop Nov 27, 2018

    otto2 , Nov 27, 2018 :
    Yes, we can.

    Still trying to arrange another meeting, hopefully Oneplus can help a bit, and @NeVeR_SeTTLe @Dunnow @script, @woSch and some more can join for some drinks and photowalks. @Joel Jacob told me about the Shot on Oneplus Acadamy ( SOOPA ) in India. Would like to arrange something like this in europe.

    buntycubal, xnutzii, Dunnow and 2 others like this.
  20. Herbert_Lagos
    Jelly Bean Nov 27, 2018

    Herbert_Lagos , Nov 27, 2018 :
    Fantastic.... Thanks for making me discover this focus stacking option on Open Camera and full tutorial.