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_fieldthe zone that looks sharp: {near, far, total, hyperfocal}, for lens focal length at aperture f focused at dist
Functions
Section titled “Functions”depth_of_field
Section titled “depth_of_field”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
1depth_of_field(85 mm, 1.8, 3 m){near: 2938.44 mm, far: 3064.19 mm, total: 125.751 mm, hyperfocal: 139231 mm}2depth_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
More examples
Section titled “More examples”1# how much is sharp for a portrait at 3 m2depth_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 sensor4depth_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.