Skip to content

art.photo

camera math like how much of a shot is in focus

Camera calculations. Sensors are named by their type, like "full frame" or "aps-c".

Tags: art

  • depth_of_field the zone that looks sharp: {near, far, total, hyperfocal}, for lens focal length at aperture f focused at dist
depth_of_field(focal: quantity, f: num, dist: quantity, sensor?: str) -> map

the zone that looks sharp: {near, far, total, hyperfocal}, for lens focal length at aperture f focused at dist

sensor is full frame, aps-c, aps-h, micro four thirds, 1-inch or medium format, and defaults to full frame. far is inf at or beyond the hyperfocal distance

1
depth_of_field(85 mm, 1.8, 3 m){near: 2938.44 mm, far: 3064.19 mm, total: 125.751 mm, hyperfocal: 139231 mm}
2
depth_of_field(50 mm, 2.8, 5 m, "aps-c"){near: 4528.05 mm, far: 5581.77 mm, total: 1053.72 mm, hyperfocal: 47542.4 mm}
Example outputCtrl+Enter to run
1
# how much is sharp for a portrait at 3 m
2
depth_of_field(85 mm, 1.8, 3 m){near: 2938.44 mm, far: 3064.19 mm, total: 125.751 mm, hyperfocal: 139231 mm}
3
# the same on a crop sensor
4
depth_of_field(50 mm, 2.8, 5 m, "aps-c"){near: 4528.05 mm, far: 5581.77 mm, total: 1053.72 mm, hyperfocal: 47542.4 mm}
Example outputCtrl+Enter to run

Example results generated on 2026-11-04. Ones using now, today or randomness will differ when you run them.