1. Welcome to NikonCafe.com—a friendly Nikon camera & photography discussion forum!

    If you are thinking of buying a camera or need help with your photos, you will find our forum members full of advice! Click here to join for free!

Multiple focal layer technique for extended DOF - very long!

Discussion in 'General Technical Discussion' started by Harry S., May 22, 2005.

  1. This post is very long, so I suggest printing it and sit down somwhere with a real coffee for reading it.

    Martin ("kramp") asked me to describe my technique of combining several focal layers for shooting very tiny subjects.

    In former days I did this with just one photo and a tremendously stopped-down lens – as expected, diffraction never allowed me to produce such sharp and detail-rich pics as the one shown in this original post.


    The digital era changed this dramatically. Many of my colleagues tried to combine focal layers but whenever I looked at the results there was something wrong with the proportions. So I started to experiment until I reached my current state of skill (which by far is not the possible top end).

    I have described this technique in DPR a while ago but have decided to create a more detailed tutorial this time because others might be interested as well.

    Important: This technique works only with static subjects!

    - Good macro optics to achieve a much more than life size magnification ratio.
    - A focussing rail that allows precise or near precise vertical movements in hair's breadth increments
    - A good lighting setup.
    - Photoshop and a computer with sufficient RAM
    - A graphic tablet for drawing masks might also be very convenient
    - A somewhat more than very basic knowledge in PS.

    The problem with very tiny (in this case) beetles is that the available DOF never completely covers the vertical extension of their often convex or even highly vaulted bodies. Extremely small apertures cause diffraction and actually undo the gain in DOF. The solution is to capture several images at different focal planes and combine them PS (or even use a software that does it automatically).

    The Setup:
    I use a wide range of macro optics depending on the subject size. For very small subjects (1-3mm body length) I use a Leitz Photar 25mm/2.5 attached to a Novoflex bellows (Balpro). The bellows is mounted to a repro-stand via a focussing rail. The focussing rail has a vertical focussing screw which allows more or less precise movements in hair's-breadth increments.
    The camera is a D1X tethered to the PC with all settings usual for macro still work with long exposures (mirror lock-up, etc.).
    Very important: You have to avoid anything that carries the prefix "Auto-", particularly White balance. I usually shoot in manual mode, with preset WB. You don't want to end up with different color casts on each individual layer.

    In case of larger beetles I attach a 60mm Leitz to the bellows or even use the naked 60mm Micronikkor.
    I could even make use of a 12.5mm Photar, but the working distance would become too short for efficient use of light.

    This is one of the most crucial factors for good macro photography. I use two halogen light sources with fibre optics (two goose necks each). Two achieve the most even lighting I filter the light through two layers of diffusion foil (used by the movie people for lamps). This is vitally important to reproduce metallic colors. A blue filter in front of the light source gives it almost the exact color temp of flashlight.
    Picture of lens and lighting:
    Subscribe to see EXIF info for this image (if available)

    One downside of this is that scattered light might hit the front element of the lens and cause unwanted flare. I have not tried it yet, but a set of small "gobos" might help.

    Another problem is that in very glossy specimens the lens and camera are reflected on the specimen which results in a black blotch, which seems impossible to get rid of. A solution might be to increase the working distance, but that requires special optics (see links below). I have also seen setups with polarizers in front of the light source, but this might also eliminate desirable reflections.

    Bottom: Many insect specimens in collections are mounted on pins or on pinned cards. In former times I just stuck the pins in plastazote or styro foam (see picture above). The downside of this is that this material is elastic and takes some time to settle. I often had some inexplicable blur because I did not recognize that the pin is still slightly moving. Now I use plastilin (bees wax works as well).

    The procedure:
    That's the easier part. Since DOF is not important you may set the lens to the peak performance. I don't go beyond f/8 with the Photar and f/11 with the 60 Micro. Just focus on the top of the specimen and shoot. When the image appears on the monitor, check if the top layer is really sharp (control through the view finder may be tricky).
    Then turn the focussing screw for the next layer – this is a matter of experience, the larger the magnification, the shorter the turn. Check the next layer on the monitor. Toggle back and forth between the pics. There should be a tiny overlap in the focussed areas.
    Important: Avoid to touch the camera when turning the screw. The straight x/y misalignments may be easily corrected in PS, but touching the camera often causes slight rotations which are much harder or even impossible to correct.

    Combining the layers:
    Depending on the vertical extension of your subject you may end up with 4 – 15 layers.
    Open the top layer in PS. Open the next layer > Ctrl A > Ctrl C > close. Then just copy this file into the previous one. Layer appears as a separate layer above the background layer. Continue with this procedure until all layers are in one document.
    * If you shoot in .tif, the document might become very large, so if you don't have a RAM monster, it's better to split the work flow and combine 4 layers, after flattening import the next 3 or 4.

    Now comes the tricky part:

    Alignment and resizing:
    (As a preparation to speed your work, you should write an action set containing actions with transform commands for resizing. I have actions for all 0.1% increments between 99.9 and 99.0).
    Deactivate all layers excpet the background layer and the next one. Lower opacity of layer 2 to about 50% to be able to see both. Correct wrong alignment with the move tool (and the cursor keys). By repeatedly deactivating and activating layer 2 you will immediately recognize that the specimen in layer 2 is somewhat larger (which is clear because you moved the lens closer to the subject). Now you have to transform layer 2 until it perfectly matches the background layer.

    When this is done to your satisfaction, return to 100% opacity, add a layer mask and invert it. Then choose a white, moderately soft-edged brush and paint over the areas of layer 2 which are in focus. Actually I paint everything white that is not in focus on the background layer, because everything else becoming a bit sharper, makes subsequent alignment much easier.

    All you have to do now is repeat this step one by one with each subsequent layer. You will recognize that you have to choose increasing amounts of resizing with each step.

    When everything is done, flatten the layers and you have a pic that is sharp throughout the entire Z-axis.

    Now comes the usual enhancement work flow, which I use to do after replacing the back-ground. This I usually do by a color channel mask. Only when I have not enough contrast between fore and background I use different methods.
    I do levels adjustments with the final mask activated because then the histogram shows me only the information of the subject.

    All insect pics (except the out door pics) in my gallery ahve been done using this technique:

    Additional information:
    As mentioned above, it is sometimes useful to have longer working distance which is difficult to achieve at high magnification ratios.
    There is a US company that offers custom solutions:
    Among their products are some very useful items, like a long distance microscope, a fibreoptic lamp that can produce flashes, an accentuator that allows vertical movements of the focussing rail controlled from the PC, a video camera attache to the viewfinder which transfers a magnified viewfinder image to the monitor, etc.

    Also there are different kinds of software to automatize the combining process. There are freewares (like CombineZ5; sorry, don't have a link ready) or a very expensive one (the best, however) like Automontage by syncroscopy:

    Anyway, I hope this was informative. I am sure there are many issues which I forgot to mention, but some of them are difficult to explain by words and may be figured out by practise and experiment.

    Any additional questions will be gladly answered and suggestions for improving this technique or the setup are highly appreciated.
    Last edited by a moderator: Mar 15, 2017
  2. Hell Up!! This is going to make interesting reading, and to say your work is not top end is ludicrous. What else are you expecting to achieve a 'walking talking' exhibit, and who are you measuring yourself against. Probably yourself, and we all do that.
    Thanks for going to the all the trouble of compiling this post. I am sure that it will be very much appreciated by a large number of the members.

    BW to Helen. From Bob and Pam.
  3. Gale


    Jan 26, 2005
    Viera Fl
    Excellent Harry,

    Now I don't see me doing any of this. Guess I would just have to send you the bugs..

    I have a huge dead dragon fly in a plastic bowl with lid to keep him from getting ruined. It is all transparent. Very fragile.

    What I am going to do with it or why i keep it I have no idea. Just think it is neat.

    Maybe I will try to take a pic of it in the winter when I can't go out :>))

    Looked at you images on pbase. Great stuff. Left a msg tooo.

    Thank you for your great tutorial. That is alot of work to photo a bug.
  4. Wow Harry, I just finished looking at your gallery and it is truly impressive. The detail in the beatles is amazing. Well done.
  5. Thank you very much for the excellently written tutorial Harry, I can't wait to try it out.

    Which focus rails have the fine adjustments needed for the higher magnifications, I have the Manfrotto and it just doesn't seem to be up to the task.

  6. Harry, you SURE are THE professor ;-)
    Thanks for the wonderful tutorial.
  7. cwilt


    Apr 24, 2005
    Denver, CO
    Excellent tutorial and bug photos. If I ever get that serious about macro I know who ask for advice. :) 

  8. Martin, I use a Kaiser Micro-positioning Plate which is practically identical to the Bogen/Manfrotto product. I am not content either, because the screw doesn't move as smoothly and regularly as I would like. The best thing would be the fine focussing drive of a microscope, because that would also spare me the alignment corrections afterwards.

    I am really looking forward to use the new setup I have in the institute:
    A Leica MZ 16 with a Leica digicam and the mentioned "Automontage", but to get the thingy operational I have bring together three people: the Leica guy, the lady from the software supplier and our admin, and that seems nearly impossible. I'm specifically curious for the stereoscopic microscope because it's said to have fabulous optics.
    I'll let you know for sure when the whole contraption works.
  9. Thanks to all. I am happy that the time it took me to contrive this wasn't a waste of time.
    Thanks also for the comments on my galleries.

    Now, if someone could invent a device that does all that in, let's say, 1/1000 s we might also use it in the field :lol:
  10. Chris101


    Feb 2, 2005
    This is cool. Thanks Harry!

    By the way, I hate earwigs, and your photos just made it pathological. ;) 
  11. Ha, Chris, you fell into the trap :lol:
    Actually, the ones you probably mean are rovebeetles. However, when I try to exlain to laymen what they look like I always say "like earwigs, but without the forceps on the rear end".
  12. Thanks for a very helpful tutorial!

    This tutorial has helped me immensely with a couple of issues I've been struggling with when trying to accomplish a similar effect in landscape images. The Internet and forums like this truly fullfil their promise when such helpful information is exchanged between people who otherwise would never have met.

    This exchange process requires that there be people like you who are both talented and willing to share their knowledge, and you have been very generous in that regard!

    One issue you pass over quickly is (I'm a little embarrassed to admit) the transform function:

    "Now you have to transform layer 2 until it perfectly matches the background layer. "

    Photoshop Help is not very helpful with regard to how to do this or how this function works. I've experimented with it since reading your post, but I have only a dim idea what's going on. And the many Photoshop books I have make no mention of the function. Is there a source that comes to mind that you could direct me to?

    Thanks again for a very detailed and useful tutorial.

  13. Re: Thanks for a very helpful tutorial!

    Mike, you are right - that is what a forum should be about, and so far the Cafe is very good at this.

    O.k., let's try. I hope I can make myself understandable since I work with a German version of PSCS.

    With the second layer highlighted, you just hit Ctrl+T. Right below the menu bar, another bar will appear which shows you all the transform options. There are two fields showing "100%". Next step is to link the two fields by clicking the chain between them. Then you enter the percentage you want in one of the fields (e.g. 99.8%) and confirm by pressing the "enter" key. That's it.

    BTW - good that you reminded me of making use of this technique for landscape photography. I guess it might also be possible to combine this technique with panoramic shots where you change the focus from near to far. Boy, that sounds complicated, but since I love challenges like these, I have to try that one day. Especially since there is no wide-angle tilt/shift from Nikon in sight.

    Again, I'm happy that, for a change, I could contribute something that made sense :lol:
  14. Mike, I forgot something.
    I always wondered if turning the focus ring changes the optical properties of a lens. In my technique I move the entire set-up closer towards the subject, so nothing changes except for the area in focus.
    I guess we will need some of the specialists like Bjorn or Ilya to clarify that issue.
  15. Thanks, Harry

    Harry -

    First, thanks for the great answer! You should write the books in English, too.

    As for your question above, it depends on the lens. And my technique until now has really emphasized how this varies from lens to lens.

    My technique has been to take two or more exposures, focusing at a different significant point in the scene in each exposure. I've combined these in Photoshop by making each version a layer, and using the history brush (wonder what that's called in German) to paint the most in-focus portions of the "active" image into the "base" image that I've chosen to start with.

    Depending on the kind of scene, the "bottom" or "base" image may be the one with the closest focus point or the farthest. Whichever will require the least painting and potential for errors.

    I started this project using a Sigma 15-30 on a D2h. Regardless where I focused, each image lined up perfectly with the others.

    That all changes with the 28-70, which produces the same effect you describe in your tutorial. Foreground elements look bigger in the image when the focus point is in the foreground. Depending on the nature and complexity of the image, this may or may not be a problem. It isn't where the foreground, middleground and background elements are physically separate and there's no other indication what their relative sizes should be.

    This changes when important elements in the image overlap, or run through the entire image or a significant portion of it, so as to go from one "zone" to another. This is where I hope to apply the technique you so carefully lay out for us. It's been quite a revelation! It never occurred to me that I could effectively "resize" the image in one layer to match another and eliminate the problem I was having. So now I'll try it!

    When I get back from the dentist, I'll try to find one of the more successful images employing my initial system and post it here.

    Thanks again for all the help!

  16. Re: Thanks, Harry

    Mike, don't worry, I know most of the English terms in PS due to extensive forum activity, also most tutorials are in English. Sometimes, however, I am at a loss and have to circumscribe things. But usually people understand what I mean and even correct my clumsy expressions :)  .

    That reminds me that I have to visit the dentist, too. It's been a year since my last routine check.

  17. Expanded DOF image


    I promised an expanded depth of field landscape image after I got back from the dentist.

    Well, it's the next day now, but it literally is after getting back from the dentist. :) 

    The attached image was taken when the wildflowers were at their peak here in Arizona. I couldn't find any broad fields of flowers to use as a foreground, so simulated the effect of a large field by literally sticking the camera down into the biggest patch of flowers I could find.

    The closest flower is just inches in front of the lens. Focusing on it put almost everything else out of focus. Focusing at the hyperfocal distance put all the foreground flowers out of focus. So I focused on the closest flower, another flower in the middle foreground, then the Saguaro cactus, then the moutain in the distance. (Perhaps overkill, but what the heck, I was learning.)

    Since I was using the Sigma lens, each of the images was the same size. And the elements in the images were relatively separated from the environment behind them, so the process of combining the images with the history brush system described earlier was fairly easy.

    Unfortunately, the flowers were gone by the time the D2x arrived. And while it isn't completely clear from this relatively low-rez image here, everything really is in focus. It prints very nicely at 8x10, and I've even sold one!



    Subscribe to see EXIF info for this image (if available)
  18. Mike, that pic is awesome! This is exactly the effect I'm hoping to get with a WA tilt/shift lens. Maybe the multifocal technique is a way to circumvent the lack of such a lens. Can't wait for the weekend (possibly without wind)to try it.

    Thanks for posting that nice pic
  19. Thank you, Harry

    . . . for your kind compliment. This is my favorite image of the series I was doing when the poppies were in bloom. The others are similar, and have poppies in front of Cholla cactus, or poppies in front of Ocotillo, or poppies in front of . . . well, you get the idea.

    Let's hope the conditions are just right for you! I bet you get wonderful results.

    Warm regards,

  20. Gale


    Jan 26, 2005
    Viera Fl

    Not sure how I missed this post. Thanks to Martin to link back to it.

    I need all the tutorials I can get. Bugs or otherwise. Yeah I do shoot bugs at time. Not to good though. Just find them fascinating. Especially the really colorful ones. Nature produces some amazing creatures and colors.

    Will print this.
    Got to go get ready for work now.

    Thank you very much.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.