Catalog/eng-depth-of-field

Engineering

f-number, hyperfocal & DOF API

Computes camera f-number / aperture diameter, hyperfocal distance and near/far depth-of-field limits from focal length, aperture, subject distance and circle of confusion using the standard thin-lens DOF model. Answers 'What is the hyperfocal distance?', 'How much of the scene will be in focus?'.

Price$0.06per request
MethodPOST
Route/v1/engineering/depth-of-field
StatusLive
MIME typeapplication/json
Rate limit120/minute
Cache0s public
opticsphotographydepth-of-fieldf-numberaperturehyperfocalcameracircle-of-confusion
API URLhttps://x402.hexl.dev/v1/engineering/depth-of-field
Integration docs
Example request
{
  "focalLengthMm": 50,
  "fNumber": 8,
  "subjectDistanceM": 5,
  "circleOfConfusionMm": 0.03
}
Example response
{
  "fNumber": 8,
  "apertureDiameterMm": 6.25,
  "hyperfocalDistanceM": 10.4667,
  "nearLimitM": 3.3894,
  "farLimitM": 9.5274,
  "depthOfFieldM": 6.1381,
  "circleOfConfusionMm": 0.03,
  "interpretation": "Acceptably sharp from 3.389 m to 9.527 m (DOF 6.138 m)."
}
Input schema
{
  "type": "object",
  "required": [
    "focalLengthMm",
    "subjectDistanceM"
  ],
  "properties": {
    "focalLengthMm": {
      "type": "number",
      "description": "Lens focal length (mm)",
      "examples": [
        50
      ]
    },
    "fNumber": {
      "type": "number",
      "description": "Aperture f-number (provide this or diameter)",
      "examples": [
        8
      ]
    },
    "apertureDiameterMm": {
      "type": "number",
      "description": "Aperture diameter (mm)",
      "examples": [
        6.25
      ]
    },
    "subjectDistanceM": {
      "type": "number",
      "description": "Focus distance to subject (m)",
      "examples": [
        5
      ]
    },
    "circleOfConfusionMm": {
      "type": "number",
      "description": "Circle of confusion (mm, default 0.03 for full-frame)",
      "examples": [
        0.03
      ]
    }
  }
}
Output schema
{
  "type": "object",
  "additionalProperties": true
}