What is the best method to get a magnification effect within an image.

More specifically, I am interested in getting a portion of the image zoomed in, with a boundary and the zoom lines annotated, such as is done in this image:

The best solution I have found is to use emulate a magnifying glass directly, like here:

enter image description here

However, I don't like that it adds distortion around the edges, and it doesn't zoom enough - which is why I added the images above. It would be great if the images above the glasses could be in a frame which was indicating the region from which they were being zoomed into, so that you could easily see two scales in the image.

Is there a way to add a frame with zoom lines to a region which is being drawn with another camera like this?

  • 1
    $\begingroup$ Related: blender.stackexchange.com/questions/38139/… $\endgroup$
    – Paul Gonet
    Commented May 16, 2017 at 20:03
  • 2
    $\begingroup$ You want it for a still render or animation? $\endgroup$
    – Paul Gonet
    Commented May 16, 2017 at 21:20
  • 1
    $\begingroup$ Is it a blender zero budget challenge or some specific reasons that you don't want to do it in post? For me it's like a 101 post editing thing if you do it in After Effects. $\endgroup$ Commented May 19, 2017 at 9:43
  • 1
    $\begingroup$ @chase - updated my answer to work on the 3d scene rather than be restricted to a flat image plane. Hope this helps. $\endgroup$ Commented May 23, 2017 at 8:48
  • 1
    $\begingroup$ @RichSedman Thank you SO much! Your answer is fantastic and I learned an incredible amount from reading through it. I love that you included the blender files, animations, and thorough description. Your work is absolutely wonderful and I greatly appreciate it! $\endgroup$
    – chase
    Commented Jun 1, 2017 at 4:08

3 Answers 3


An alternative solution is to use a Refraction shader. Since this does not require changes to the geometry of the original "image" it can be very easily animated.

final animated example

The key is to be able to control the bending of each ray hitting a surface (the zoom window) into a particular direction, irrespective of the incoming angle of the ray. This allows the camera rays to be directed towards a specific area of the distant image to visually 'lift' a section of the image closer to the camera (similar to Paul Gonet's excellent answer but without actually changing the geometry).

Normally the Refraction shader will bend the incoming ray based on the refractive index and the incoming light ray path. For rays 'entering' a denser material, the rays will typically bend towards the surface normal. For rays 'leaving' a denser material the rays will bend away from the surface normal - with the amount of bending based on the angle of the incoming ray (so rays along the Normal will not be bent but those at steeper angles will be progressively more bent).

A surface with an infinite refractive index would bend all incoming rays so that they exit along the surface normal. Similarly, a surface with a refractive index of zero will bend all 'outgoing' rays along the surface normal. Since we can control the direction of the surface normal we can use this to control the precise direction of any rays passing through the surface. Note that we can't actually enter a refractive index of infinity (the node doesn't allow it), but the same effect is achieved by flipping the normal (so rays hit the surface from the "back" and use an IOR of zero.

To start with, create a plane to act as the 'start' of the pipe (the 'zoom window'). Set its dimensions as desired and duplicate it (Shift-D) to create an exact copy to be the 'end'. Create the following material and assign it to the 'end' plane - this will be used to highlight the area of the image that is currently being zoomed :

endpoint material

Note that the material mixes between a pair of transparent shaders based on the Ray Depth, each with different colours. The plain white transparency is to ensure the material is invisible when viewed through the zoom window (we don't want that tinted), whereas the coloured transparency highlights the section of the original image being shown in the zoom window.

Create the following material and assign it to the 'start' plane :

startpoint material

Note the Refraction shader with IOR set to 0.000. Flip the normal of the plane (or rotate it around the X or Y axis by 180 degrees) so that the camera sees the back face of the plane. To direct the rays in a particular direction we now only need to feed the desired direction vector into the Normal of the Refraction shader. The nodes on the left-hand side of the material achieve this by calculating the difference in location (in world space) between the 'start' plane (the lower Texture Coordinate node) and the 'end' plane (the upper Texture Coordinate node - note the use of the Object field to indicate that the coordinate should be in relation to the 'end' plane).

The 'zoom lines' are added by way of a Cube that is 'hooked' at one end to the 'start' plane and the other end to the 'end' plane - so that it stretches between the two. I removed the top and bottom faces to avoid z-fighting with the start and end of the "light pipe", then selected each set of vertices in Edit mode and selected 'Hook to new object' - this creates a new empty that can be tied to each of the 'start' and 'end' planes using parenting or a Copy Location constraint. The cube is shaded with a material to hightlight the edges and fade out towards the 'end' :

zoom lines material

Final result :

final render

From here it's fairly simple to add decoration around the zoom window and/or change the appearance of the 'zoom lines' cube for the desired effect.

Blend file attached

One drawback of this is that the 'target' area (the shaded part of the target image) must be close to the surface of the flat image - otherwise the direction of the light path can affect the area visible in the zoom window. This can be be best illustrated with a diagram :

simple light path

If the "light pipe" does not end close to the surface then the rays will hit a region to the side of the target - a second refraction surface can be used to 'correct' the path of the rays so that they are directed towards the surface.

straightened light path

The only issue remaining is that the rays emanating from the end of the 'pipe' are parallel. This works fine where the target is a simple plane but will lose any sense of perspective if the target is a more complicated scene. To fix this we can adjust the refraction plane used for the 'end' of the pipe to act like a lens. Adjusting the focal length of the 'lens' will affect the depth of the perspective.

light path with diverge lens

The material for this is as follows :

diverge lens material

(Edit : strictly speaking the Vector Transform at the bottom centre of the above image should be set to Normal mode so as to produce a correct Normal!)

Note that the 'lens' is an approximation since it is a plane rather than an actual curved surface (and the calculation is greatly simplified) - objects close to the lens can become distorted. Adjusting the 'Z' coordinate of the Combine XYZ node will adjust the focal length.

final render

  • 9
    $\begingroup$ I like how creative people can be under bounty $\endgroup$ Commented May 23, 2017 at 2:56
  • 4
    $\begingroup$ This is very clever, I really like the update too. $\endgroup$
    – 3pointedit
    Commented May 23, 2017 at 9:09
  • 3
    $\begingroup$ Wow, amazing solution that deserves a bounty! Checked your profile lately btw. Man, you're a true nodes magican. $\endgroup$
    – Paul Gonet
    Commented May 23, 2017 at 19:42
  • 3
    $\begingroup$ Bending light like that reminds me of the Esper Photo Analysis scene in Blade Runner. $\endgroup$
    – 3pointedit
    Commented May 24, 2017 at 7:56
  • 3
    $\begingroup$ Yes, yes it is. And Deckard is definitely a replicant. $\endgroup$
    – 3pointedit
    Commented May 25, 2017 at 7:18

You may do it using the shape keys and a freestyle rendering engine, it demands some experimenting though. enter image description here

Add a plane and texture it with your image (or use Images as Planes add on to do it). Add a camera. Subdivide a plane a few times with W. enter image description here

Duplicate the plane with Shift+D, grab it with G and place it below the original one with a very small distance value (0.0001 e.g.). This'll allow you to prevent a Z-fighting issue and be helpul in the further steps.
enter image description here

Select the part/face you want to zoom in in Edit Mode, add a shape key (in Object Mode), extrude a face (E), then scale it a bit (S). enter image description here

Select the extruded faces and give it a transparent material. enter image description here

Go to Render header and check the Freestyle checkbox there. enter image description here

Go to Render Layers header and set the color of the extruded edges in Freestyle Line Style panel. enter image description here

Change the bookmark to Thickness and set the overall thickness of the line. Add a Distance Modifier. From now it's the matter of experimenting with the settings. I recommend you to click the Fill Range by Selection button first, then decrease the Range Min to 0.000 and adjust the Range Max finally. Value Min should stay at 0.000, so the freestyle won't take the edges of a plane into account. The bigger the value of Value Max the thicker the extruded edges will be. As I said before it's all the matter of preferences- you have to experiment with it.
enter image description here

FINAL NOTES: The first .gif uses a non-shadeless material so the shadows are visible for some amount of time. Use a shadeless material to make it look better.

I tried using the UV Project modifier to make it work for the animation, but I guess it's not working well in this case. I wanted to share the results with you though, maybe you'll use this idea somehow... enter image description here enter image description here

You've asked an interesting question. I'll try to update my answer if I find new solutions in future.


Heres a solution that uses a linked scene with a second camera for the closeup. This allows you to modify the closeup shot if required, to avoid occlusions from geometry or even alter the lighting of the close angle.

Compositor and closeup camera

The master Scene contains the master geometry and close up camera. You can alter the camera and lighting (even animate the angle) while previewing in the active compositor.

Wide angle with unwrapped plane

The alternate Linked Scene has a duplicate of the master scene that repeats all (inked) changes and contains the wide camera angle. This scene also holds a UV unwrapped plane that has constraints to orient it toward the camera.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .