Sub topic 10
Composition Guides and Framing the Subject
This chapter assumes you can orbit, pan and zoom the viewport, and that you have a camera set as the scene's active camera. It also assumes you know that focal length and sensor size set the field of view, and that render resolution sets the frame's shape. The Python snippets are optional.
Framing is the decision about what sits inside the camera's rectangle and where. Blender can't make that decision for you. It does give you overlays that show common composition patterns on top of the camera view, and the settings that decide the shape of the frame.
Frame first, guides second
The camera sees a rectangle. Its aspect ratio comes from the render resolution, not from the camera data. Set the resolution before you place anything, because changing it later changes what falls inside the frame.
| Resolution | Aspect ratio | Typical use |
|---|---|---|
| 1920 x 1080 | 16:9 | Video, web |
| 1080 x 1080 | 1:1 | Square social posts |
| 1080 x 1920 | 9:16 | Vertical video |
| 2400 x 1000 | 2.4:1 | Cinematic widescreen |
Two behaviors surprise people:
- With sensor fit on Auto, the sensor size applies to the longer side of the frame. A 36 mm sensor is the width in a landscape frame and the height in a portrait frame. So the same focal length gives a different field of view on the short axis when you change the aspect ratio.
- Resolution percentage scales the output size but not the aspect ratio. It is safe for fast test renders. Changing X or Y is not.
import bpy
scene = bpy.context.scene
scene.render.resolution_x = 1920
scene.render.resolution_y = 1080
scene.render.resolution_percentage = 100Turning on composition guides
Composition guides are overlays drawn only in camera view, and they never appear in renders. Enable them in the Properties editor, on the Camera data tab, in the Viewport Display panel, under Composition Guides. Alternatively, use the Overlays popover in the viewport header with the camera data selected.
Blender provides these guides:
- Thirds splits the frame into a 3 x 3 grid.
- Center draws a cross through the middle of the frame.
- Center Diagonal draws the two corner-to-corner diagonals.
- Golden Ratio draws a grid whose lines sit at the golden proportion, close to the thirds but pulled slightly toward the center.
- Golden Triangle A and B draw a diagonal with perpendiculars from the other corners. A and B are mirrored versions.
- Harmony Triangle A and B are related diagonal-based layouts, also mirrored.
You can enable several at once, but more than two usually becomes noise. Start with Thirds.
import bpy
cam_data = bpy.data.objects["ShotCamera"].data
cam_data.show_composition_thirds = True
cam_data.show_composition_center = False
cam_data.show_composition_golden = False
cam_data.show_composition_golden_tria_a = False
cam_data.show_composition_golden_tria_b = False
cam_data.show_composition_harmony_tri_a = False
cam_data.show_composition_harmony_tri_b = False
cam_data.show_composition_center_diagonal = False
cam_data.show_passepartout = True
cam_data.passepartout_alpha = 0.9Passepartout darkens the area outside the frame so you judge the shot by what the render will contain. Without it, you tend to compose using geometry that the render will crop away.
Using the guides
Rule of thirds
Place the subject's point of interest, such as a character's eyes or a product's focal feature, on or near one of the four intersections of the thirds grid. For a horizon, put it on the upper or lower third line instead of in the middle. Choose by what matters more. A dramatic sky gets the lower line, and an interesting foreground gets the upper line.
Subject direction and lead room
If the subject faces or moves in a direction, leave more space on that side. A subject placed centrally and facing the edge of the frame feels cramped. Place it on the opposite third and leave space in front of it.
Center and symmetry
The Center guide helps in the opposite case. Symmetrical architecture, product turntables and portraits that want a formal feel all work when the subject sits exactly on the center line. Check that the camera is level and aligned, because any tilt shows up immediately against the guide.
Golden ratio and triangles
The golden ratio is a subtler version of thirds, and the triangle guides suit scenes with strong diagonals, such as a road, a railing or a character's pose. Use them to check where diagonal lines enter the frame. A strong diagonal that runs from a corner toward the subject tends to guide the eye.
Placement versus focal length
Two changes can make a subject fill more of the frame: move the camera closer, or raise the focal length. They are not equivalent.
- Moving the camera changes perspective. Relationships between near and far objects change, so the background shifts relative to the subject.
- Changing focal length from a fixed position crops or expands the view. Perspective stays the same, because it depends on camera position.
The practical rule is to decide the look first. For a compressed, flattened portrait, back the camera away and use a longer lens. For an exaggerated, dramatic sense of depth, move closer with a wider lens. Then adjust whichever of the two the look allows to get the framing you want.
Computing a distance that fits the subject
Instead of dragging the camera until the subject fits, you can calculate the distance. For a subject of height H, a camera focal length f, and a sensor dimension s along the same axis, the camera needs to be about H * f / s away to just fill that axis. This follows from the field-of-view formula. Add a margin so the subject doesn't touch the edge.
The script assumes an object named Subject and a camera named ShotCamera that is set as the scene camera. With a 16:9 landscape frame and Auto sensor fit, the effective sensor height is sensor_width * resolution_y / resolution_x.
import bpy
import math
scene = bpy.context.scene
cam_obj = bpy.data.objects["ShotCamera"]
cam_data = cam_obj.data
subject = bpy.data.objects["Subject"]
sensor_height = cam_data.sensor_width * scene.render.resolution_y / scene.render.resolution_x
margin = 1.25 # leave 25% extra room around the subject
height = subject.dimensions.z
distance = height * margin * cam_data.lens / sensor_height
# Place the camera in front of the subject, looking along +Y.
cam_obj.location = (
subject.location.x,
subject.location.y - distance,
subject.location.z,
)
cam_obj.rotation_euler = (math.radians(90), 0, 0)
scene.camera = cam_obj
print(f"Camera distance: {distance:.2f} m")This is an approximation. It measures to the subject's origin, not to its nearest surface, and it assumes the subject is centered and its origin is at its middle. A subject whose origin is at its base needs a Z offset added to the camera location. For a deep subject, subtract half its depth from the distance if you want the front surface to be the one that fits.
Aiming for the composition you want
To put the subject off-center on a third line without rotating the camera away from it, there are three options:
- Rotate the camera slightly, which also shifts the perspective on the subject.
- Move the camera sideways (a "truck") and keep it parallel to the subject. Perspective stays consistent, but the background shifts.
- Use lens shift, which moves the frame without rotating the camera. It is useful for architecture, where you want vertical lines to stay vertical. The next chapter covers it.
Option 1 is the quickest during roughing. Use Track To (covered in the positioning chapter) when the camera should keep following the subject while you reposition it.
Common mistakes
- Composing in the wrong frame. Changing resolution after composing shifts everything. Set the aspect ratio first.
- Judging the shot without passepartout. Geometry outside the frame distracts you from what the render will show.
- Tilting the camera accidentally. A small roll angle ruins symmetrical shots. Check the Z rotation and compare horizontal lines against the guide.
- Treating guides as rules. They are starting points. Breaking them deliberately, with a centered subject or an extreme corner position, is fine if you do it for a reason.
- Fixing framing with the wrong tool. If the subject looks distorted, the problem is camera distance and focal length, not placement within the frame.
Exercise
You are framing a landscape-orientation render (1920 x 1080) with a 36 mm sensor on Auto fit and a 50 mm lens. The subject is 2 m tall and you want 25% margin. How far from the subject should the camera be, using distance = height margin focal length / sensor height?
Show answer
The sensor height is 36 1080 / 1920 = 20.25 mm. The distance is 2 1.25 * 50 / 20.25 = 125 / 20.25, which is about 6.17 m.
Exercise
A subject faces right in a 16:9 frame. On which side of the frame should you place it relative to the thirds guide, and why?
Show answer
Place it on the left third line, so that more empty space is in front of it, on the right. This lead room keeps the subject from looking cramped against the frame edge.