Doop
Doop: 오픈소스 멀티플레이어 디자인 캔버스 및 AI 에이전트용 MCP
심도 시뮬레이터
Depth of field simulator
디자인TypeScript · CSSGitHub @jherr직접 설치운영자 미확인
써 보셨어요? 한 번만 눌러 주세요. 로그인은 필요 없어요.
아직 감지된 업데이트가 없습니다. GitHub 릴리스가 나오면 여기에 보입니다.
개인 계정의 공개 저장소 소유자는 GitHub로 로그인해 운영자를 확인하고 소개를 직접 관리할 수 있습니다. 관리자 승인은 필요하지 않습니다.
로그인한 뒤 확인 파일을 만들어 이 저장소의 기본 브랜치에 30분 안에 커밋해 주세요. 다른 브랜치나 포크의 파일은 인정하지 않습니다. 파일을 올린 뒤 아래에서 확인하면 관리자 승인 없이 관리할 수 있습니다. 자격을 유지하려면 파일을 남겨 두세요.
로그인이 필요하면 로그인 화면으로 이동합니다. 로그인 후 이곳으로 돌아와 원하는 확인 버튼을 다시 눌러 주세요.
설치형 프로젝트는 배포 도메인 없이도 확인할 수 있습니다. 개인 저장소는 GitHub 로그인으로, 조직 저장소는 위의 저장소 확인 파일로 직접 확인해 주세요.
메이커가 쓴 소개는 위의 한 줄이 전부입니다. 더 자세한 내용은 저장소 README에서 읽을 수 있습니다. 저장소 README ↗
README 전체를 불러오는 중입니다.
README 전문 보기 ↗A web application that allows you to figure out the depth of field of a camera lens. You can adjust the aperture, focal length, and distance to the subject to see how the depth of field changes. The application also shows the hyperfocal distance and the near and far limits of the depth of field. Live Demo
Built with React, TypeScript, Vite, and Chakra UI.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
npm install
npm run dev
Vite prints a local URL (default http://localhost:5173). Open it in a browser; edits hot-reload automatically.
npm run build
The optimized output is written to dist/. Preview the production build with:
npm run preview
| Command | What it does |
|---|---|
npm run dev | Start the Vite dev server with hot reload |
npm run build | Type-check (tsc) and build to dist/ |
npm run preview | Serve the production build locally |
npm run lint | Run ESLint over the ts/tsx sources |
npm test | Run the unit tests (tsx --test) |
All optics are computed in src/App.tsx from four inputs — focal length (f, mm), aperture (N, the f-number), subject distance (s), and the selected sensor — plus a circle of confusion derived from that sensor. Distances are tracked internally in millimeters and converted to feet/inches or centimeters for display (src/utils/units.ts).
The circle of confusion is the largest blur spot that still looks "in focus" to the viewer at normal viewing size. It scales with the sensor: a larger sensor tolerates a larger blur circle because the image is enlarged less to reach final viewing size.
Each preset sensor ships with a fixed CoC (in mm), e.g. 0.029 mm for 35mm full frame and 0.019 mm for APS-C. For a Custom sensor the CoC is estimated from the sensor diagonal:
CoC = √(width² + height²) / 1500
This is the common "diagonal ÷ 1500" rule of thumb (the full-frame diagonal of ~43.3 mm gives ~0.029 mm, matching the full-frame preset).
The crop factor compares a sensor's diagonal to the 35mm full-frame diagonal (≈ 43.27 mm). For a custom sensor:
cropFactor = 43.27 / √(width² + height²)
Preset sensors carry their own crop factor. The 35mm-equivalent focal length (shown for non-full-frame sensors) is simply:
equivalentFocalLength = focalLength × cropFactor
The hyperfocal distance H is the focus distance at which everything from half that distance out to infinity is acceptably sharp. It is computed as:
H = f + f² / (N × CoC)
where f is focal length, N is the f-number (aperture), and CoC is the circle of confusion — all in millimeters.
Given the hyperfocal distance H, the subject distance s, and focal length f, the near and far sharp limits are:
near = (H × s) / (H + (s − f))
far = (H × s) / (H − (s − f))
far − near.The Set Hyperfocal button focuses the subject exactly at H, the setting that maximizes depth of field for the current lens and aperture.
The vertical angle of view comes from the sensor height and focal length:
FoV = 2 × atan( sensorHeight / (2 × f) ) // converted to degrees
This drives how wide the cone is drawn in the scene diagram.
Stopping the aperture down (large f-number) eventually softens the image because the Airy diffraction disk grows larger than the circle of confusion. The Airy disk diameter is approximated as 0.001342 × N mm, so the aperture at which diffraction begins to matter is:
diffractionLimitFStop = CoC / 0.001342
Above this f-number a warning badge is shown. Because the threshold scales with CoC, smaller sensors hit diffraction at wider apertures than larger ones.
Internally everything is inches/millimeters; src/utils/units.ts formats the output:
12 in = 1 ft)1 in = 2.54 cm)These formulas use the standard thin-lens depth-of-field model. They are excellent for understanding and comparing setups, but real lenses (breathing, pupil magnification, etc.) can differ slightly from the idealized math.
src/
App.tsx # Inputs, state, and all DoF/CoC/hyperfocal math
PhotographyGraphic.tsx # The scene diagram (subject, focus cone, limits)
selectStyles.ts # Theme-aware styling for native selects
utils/units.ts # Imperial/metric formatting
assets/ # Lens illustrations
Issues and pull requests are welcome at github.com/jherr/depth-of-field. Please run npm run lint and npm test before opening a PR.
MIT © Jack Herrington