Inside the glass: ray-traced formula & bokeh PSFs
Both diagrams update live as you change lens, f-stop, or focus distance. Hold B to compare native; press [ / ] to step aperture.
Optical prescriptions, physics & credits
Why real lens blur differs from Gaussian portrait blur
Smartphone portrait filters typically apply a spatially uniform blur kernel in gamma-encoded sRGB over a coarse foreground mask. Real full-frame optics differ in four physical ways modelled directly on this bench:
- Metric Circle of Confusion & Distance Mapping: Full-resolution metric depth maps from Apple Depth Pro 2 (in meters) drive the thin-lens full-frame CoC equation on a 36 × 24 mm sensor. Equiv. Mag multiplies scene depths by fsim / fsrc to match subject framing magnification; Real Dist evaluates the simulated focal length at literal scene meters.
- Asymmetric Spherical Aberration & 7-λ Dispersion: Tracing 7 wavelengths (430–670 nm, CIE 1931 D65-weighted) through each patent's Schott/Ohara glass refractive indices and Abbe numbers separates front bokeh (soft bright core, warm-magenta rim) from back bokeh (defined outer ring, cool-green longitudinal chromatic aberration).
- Mechanical Barrel Vignetting (Cat's-Eye Swirl): Clipping oblique ray fans against every element's patent clear-aperture diameter naturally trims corner bokeh into tangential cat's-eye ellipses and drops corner illumination (for example, Planar 50 drops to 30% corner transmission at f/1.4 and recovers to 90% by f/4.0).
- Linear HDR Specular Convolution: Source sRGB pixels are linearized with reversible highlight headroom before PSF convolution so point bulbs, lanterns, and metallic reflections expand into luminous bokeh discs rather than flat grey circles.
Verified Patent Optical Formulas (Traced at 7 Wavelengths)
| Lens | Patent / Formula | EFL / BFL | Corner Trans. (wide) | Iris |
|---|---|---|---|---|
| Leica Summilux-M 35mm f/1.4 ASPH | US 5,161,060 Ex. 1 (9 elem / 5 grp, 2 asph) | 35.4 mm / 19.6 mm | 23% at f/1.4 (69% at f/4.0) | 9-blade |
| Carl Zeiss Planar T* 50mm f/1.4 | US 3,874,771 Ex. 5 (Contax/Yashica & ZF, 7 elem / 6 grp) | 50.0 mm / 35.5 mm | 30% at f/1.4 (90% at f/4.0) | 9-blade |
| Carl Zeiss Planar T* 85mm f/1.4 | US 3,948,584 Ex. 4 (6 elem / 5 grp Double-Gauss) | 85.0 mm / 38.2 mm | 71% at f/1.4 (95% at f/4.0) | 9-blade |
| Leica Noctilux-M 50mm f/1.0 | Leitz Wetzlar Double-Gauss f/1.0 (7 elem / 6 grp) | 52.1 mm / 27.3 mm | 16% at f/1.0 (78% at f/4.0) | 10-blade |
Privacy & Uploads
When you upload your own photograph, EXIF metadata is parsed locally in your browser and depth estimation runs entirely on-device inside a Web Worker using onnx-community/depth-anything-v2-small (WebGPU with WebAssembly fallback). Uploaded photographs never leave your device.
Read the companion write-up · Lighting a wine glass with one lamp · Inspired by @1umsensor's Depth Pro 2 lens simulator.