Create an animated ‘toytown’ effect using a crafty tilt-and-shift effect in After Effects.


Tilt-and-shift lenses allow the photographer to assign a narrow plane of focus within their image. These lenses focus on a single part of a photo or footage and shift (blur) the surrounding area to create an optical illusion that makes scenes appear as if they’re actually miniature models.

The blurred outer edges trick the eye into perceiving everything in the unblurred parts as miniature. These lenses are expensive, but you can fake the effect relatively well in Photoshop or After Effects.

As the effect becomes trendier, a growing number of creatives are doing just that – Flickr and other sites have whole photo pools dedicated to faked tilt and shift shots (tinyurl.com/2uw6yw and tinyurl.com/c3heso). In this tutorial we’re going to look at how to fake the tilt-and-shift effect within After Effects.

The effect works well for motion stock and static images alike, and used creatively it can offer enough control to create cinematic focal changes, as well as the ‘toy town’ approach we’re looking at here.

We’ll be using a static image for this tutorial, which can be downloaded for free from Flickr at this link: tinyurl.com/bzkte6. The photographer, Joshua Davis, has released the image under a creative commons licence, so you can use it in your projects as long as you credit him and take care not to breach the conditions of the Creative Commons licence (which are at tinyurl.com/54sd7d).


01. Open After Effects and create a new composition three seconds long, with a frame rate of 25fps and square-pixel PAL as the format. It’s easier to understand what’s going on if you opt for square pixels, so unless your project demands a different format, this is the best option.


02. Select File > Import > File. Locate and select your chosen footage file – in this case, the Flickr file from the tutorial’s introduction. Whether you’re using motion footage or a still image, the process here is the same. Once your footage is imported, drag it into the timeline to create an instance of the footage within the composition.


03. This effect works by animating the focal point of a lens blur over the footage. In order to allow the focal length to have any effect, we need to define a depth map for our footage. Create a new solid layer by choosing Layer > New > Solid. Name it ‘Depth Guide’ and ensure it’s the same size as your composition. The colour doesn’t matter.


04. The depth map works by indicating distance to the lens-blur effect. White pixels in the map are considered to be close to the camera and black pixels far away. Shades of grey in-between are closer or farther away, according to their luminance value. This all means that the ideal way to create a depth map quickly is to use a gradient from white to black. Highlight the solid layer then select Effect > Generate > Ramp. Leave all the settings at their default values. Finally, After Effects will only recognize this as a depth map after you’ve pre-composed the solid layer so choose Layer > Pre-Compose. Select Move Attributes into New Composition.


05. We’re now ready to add the blur effect to our footage. Start off by turning off the eyeball symbol for the ‘Depth Guide’ layer so you can see your footage once again. Click on the footage in the timeline and select Effect > Blur & Sharpen > Lens Blur. When After Effects has done its work, you should see your footage completely blurred.


06. Make sure your Effect Controls panel is visible and locate the Depth Map Layer attribute, near the top of the panel. From the drop-down menu choose the ‘Depth Guide’ layer. After Effects will now render out the effect again, this time taking into account the depth map we’ve just provided it with.


07. The default settings show the focused part of the composition at the top of the window, and it’s quite subtle. To get the tilt-and-shift effect, we’re going to need to increase the amount of blur by quite a hefty amount. Change the Iris Radius setting to 70. The downside to opening up the iris is that it takes longer for After Effects to render the blur, so you might want to halve the resolution to speed things up a bit.


08. Next, we’re going to set the point of focus. Find the Blur Focal Distance setting in the Effects panel and increase it. For this image, a value of around 190 will give a good point of focus near to the front of the composition. This will vary from project to project, so have a play around.


09. Now we’ve got our final point of focus, move the playhead to the end of your timeline and click on the stopwatch next to the Blur Focal Distance setting. This creates a keyframe for the focal value. Move back to the beginning of the timeline and set the Blur Focal Distance to a lower amount we chose a value of 100.


10. Press U on your keyboard to reveal the Blur Focal Distance keyframes in the timeline. Select both of them and press F9 to turn them into Easy Ease keyframes. This will create a more natural focal change movement and help to make it look like a blur in-camera rather than one generated in After Effects.


11. Models tend to be brightly painted and more garish than real life so we’re going to add some adjustments to increase the contrast and over-saturate the colours. Make sure the footage layer is selected then choose Effect > Color Correction > Curves. Add a slight S shape to the curve to increase contrast.


12. Select Effect > Color Correction > Hue/Saturation. Increase the Master Saturation to 30. You’ll find that every project will need different amounts of increased contrast and saturation, so don’t take these numbers as gospel; do what feels right for your footage.


13. Add a vignette by choosing Layer > New > Solid. Select black, and make sure the solid is the same size as the composition. Double-click on the Elliptical Mask tool to create an ellipse that fits the composition perfectly. Next press M on your keyboard twice to reveal the mask properties. Click on the mask to select it then change the mode from Add to Subtract. Set the feather to 150 pixels, the expansion to 90 pixels and the opacity to 66%. Finally, change the blending mode of the layer to Multiply.


14. Do a test render to get an idea for how the animation works overall. Be prepared to go and make a cup of tea while this is rendering out, though, as the lens blur can be extremely processor-hungry.


15. Once you’ve had a chance to review your render, go back and make any changes needed to the point of animation, the focal length and easing. When you’re completely happy, do your final render and insert the footage into your project. Having this effect under your belt opens up a range of possibilities, so experiment with it and see what new perspectives it might help you achieve.


Who: Sam Hampton-Smith has worked as a graphic designer and web developer for over ten years. He set up a design studio in 2001, and lives in Scotland with his wife and three children. As well as being a full-time designer, he teaches graphics students at HNC and HND level, regularly writes and illustrates for magazines, and especially enjoys typography.
Contact: www.ohwrite.co.uk
Software: Adobe After Effects
Time to complete: 30 – 60 minutes