보케의 원리

How bokeh forms

초점 밖의 빛이 렌즈 조리개 모양을 따라 둥근(또는 다각형) 원반으로 퍼지는 현상. 초점에서 멀수록 원반이 커집니다.

다른 이름: BokehCircle of confusionDefocus blur
···
html
<div class="stage">
  <div class="subject"></div>
  <div class="pts" id="pts">
    <i style="left:14%;top:20%;background:#fff6c4"></i>
    <i style="left:30%;top:58%;background:#ffd1e8"></i>
    <i style="left:70%;top:16%;background:#c9d6ff"></i>
    <i style="left:84%;top:52%;background:#c9ffe8"></i>
    <i style="left:58%;top:76%;background:#ffe3c4"></i>
  </div>
  <div class="tag" id="tag">In focus</div>
</div>
css
.stage{position:absolute;inset:0;background:#0c0c14;overflow:hidden}
.pts{position:absolute;inset:0}
.pts i{position:absolute;width:7%;aspect-ratio:1;border-radius:50%;transform:translate(-50%,-50%);
  opacity:1;transition:width 1.2s ease,filter 1.2s ease,opacity 1.2s ease}
.pts.defocused i{width:22%;filter:blur(4px);opacity:.65}
.subject{position:absolute;left:38%;bottom:0;width:24%;height:62%;border-radius:50% 50% 8% 8%/60% 60% 6% 6%;
  background:#05050a;box-shadow:0 0 0 1px rgba(255,255,255,.06)}
.tag{position:absolute;left:7%;bottom:6%;font:700 11px ui-monospace,monospace;color:#e8e8f0;
  background:rgba(255,255,255,.08);padding:3px 9px;border-radius:20px}
js
const pts=document.getElementById('pts');
const tag=document.getElementById('tag');
function toggle(){
  const on=pts.classList.toggle('defocused');
  tag.textContent=on?'Out of focus':'In focus';
}
setInterval(toggle,1700);

카메라가 어떤 거리에 초점을 맞추면, 그 거리를 벗어난 점 광원은 필름·센서 위에서 완벽한 점이 아니라 원반 모양(circle of confusion)으로 퍼집니다. 이 원반의 모양은 실제로는 조리개(aperture)의 날(blade) 개수를 따라가기 때문에 오각형·육각형 보케가 생기기도 합니다.

데모는 초점이 맞을 때(작은 점)와 초점이 나갈 때(크고 부드러운 원반)를 교차시켜, 같은 광원이 어떻게 달라지는지 보여줍니다. 앞쪽 피사체 실루엣은 항상 선명하게 두어 '초점면 안의 것만 선명하고 그 밖은 흐려진다'는 원리를 대비시킵니다.

CSS로는 진짜 조리개 다각형까지 재현하긴 어렵지만, 크기가 다른 원에 blur와 투명도만 줘도 충분히 그 인상을 만들 수 있습니다. 장식용 배경(보케 항목)과 다른 점은, 이건 '초점이 이동하면 같은 점이 커진다'는 인과관계 자체를 보여준다는 것입니다.

언제 쓰나

왜 배경 조명이 부드러운 원반으로 찍히는지 설명할 때, 조리개 모양(원형에 가까울수록 부드럽다)을 이야기할 때 씁니다.