Bokeh Shape & Highlights
Out-of-focus lights drawn as discs, hexagons, stars or diamonds, growing as the aperture opens.
AI prompt
Night street photograph with a person in a dark coat sharp in the centre, behind them dozens of out-of-focus city lights rendered as large soft round bokeh discs in warm amber and cool blue, slightly brighter rims on each disc, creamy dark background, shot on an 85mm lens at f/1.4, shallow depth of field, cinematic and quiet. Variants: hexagonal bokeh from a stopped-down lens, star-shaped bokeh from a custom filter, diamond bokeh. Negative: sharp background lights, noise, lens flare streaks, text, oversaturated colour. Reduced motion: static image.About this pattern
Definition
Bokeh is the look of out-of-focus highlights. Every bright point becomes a small copy of the lens opening: round for a wide-open aperture, polygonal when the blades show. The wider the aperture, the larger and softer the discs.
When to use it
- Disc size follows aperture: lower f-number gives bigger discs and a creamier background.
- Edges are slightly brighter than centres on many lenses, which gives the soap-bubble look.
- Name the shape in prompts only when you want it: hexagonal bokeh, round creamy bokeh.
What the controls do
- Four shapes and an Aperture slider from f/8 to f/1.4.
Motion & timing
- Size and shape change instantly.
- Reduced motion: nothing animates.
Tips & variations
- Keep bokeh away from the subject so it frames rather than competes.
- Use fewer, larger discs on small screens.
Code of this live preview
<div class="bx"><div class="sc" id="sc"></div><div class="pre" id="pre" role="group" aria-label="Shape"><button data-p="0" aria-pressed="true">Round</button><button data-p="1" aria-pressed="false">Hexagon</button><button data-p="2" aria-pressed="false">Star</button><button data-p="3" aria-pressed="false">Diamond</button></div><label class="rw">Aperture <b id="av">f/2.8</b><input id="ap" type="range" min="0" max="100" value="50"></label></div>:root{--bg:#F1F1EF;--surface:#fff;--surface-2:#F7F7F5;--line:#E0E0DC;--text:#171717;--muted:#6f6f6f;--accent:#171717;--accent-ink:#fff;--danger:#d92d20}
*{box-sizing:border-box;margin:0}
.pre{display:flex;gap:5px;flex-wrap:wrap}.pre button{height:28px;padding:0 11px;border-radius:99px;border:1px solid var(--line);background:var(--surface);font-size:11px;cursor:pointer}
.pre button[aria-pressed=true]{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
.bx{width:min(330px,100%);display:grid;gap:9px}.rw{display:grid;gap:3px;font-size:11.5px;color:var(--muted)}.rw b{color:var(--text);font-weight:600}input[type=range]{width:100%;accent-color:#171717}
.out{font-size:12px;color:var(--muted);line-height:1.4}.out b{color:var(--text)}
button:focus-visible,input:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.sc{height:140px;border-radius:12px;position:relative;overflow:hidden;background:linear-gradient(#10131c,#1b1f2e)}
.sc i{position:absolute;display:block;transform:translate(-50%,-50%);background:radial-gradient(circle,rgba(255,255,255,.18),rgba(255,255,255,.55) 80%,rgba(255,255,255,.7));mix-blend-mode:screen}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}const SH=['circle(50%)','polygon(25% 5%,75% 5%,100% 50%,75% 95%,25% 95%,0 50%)','polygon(50% 0,61% 35%,98% 35%,68% 57%,79% 91%,50% 70%,21% 91%,32% 57%,2% 35%,39% 35%)','polygon(50% 0,100% 50%,50% 100%,0 50%)'],CC=['#ffb347','#ff8c5a','#7aa8ff','#ffd98a','#8ad0ff','#ff9ec4'],sc=document.getElementById('sc'),ap=document.getElementById('ap'),bs=[...document.querySelectorAll('#pre button')];let p=0;
let sd=5;const rnd=()=>(sd=(sd*1664525+1013904223)%4294967296)/4294967296;const pts=Array.from({length:14},()=>[rnd()*100,rnd()*100,CC[Math.floor(rnd()*CC.length)],.6+rnd()*.8]);
sc.innerHTML=pts.map(()=>'<i></i>').join('');const els=[...sc.children];
function up(){const a=+ap.value,sz=8+a*.5;els.forEach((e,i)=>{const q=pts[i],s=sz*q[3];e.style.cssText='left:'+q[0]+'%;top:'+q[1]+'%;width:'+s+'px;height:'+s+'px;clip-path:'+SH[p]+';background-color:'+q[2]+';opacity:'+(.85-a/100*.35).toFixed(2);});
document.getElementById('av').textContent='f/'+(8-a/100*6.6).toFixed(1);bs.forEach(b=>b.setAttribute('aria-pressed',String(+b.dataset.p===p)));}
bs.forEach(b=>b.addEventListener('click',()=>{p=+b.dataset.p;up();}));ap.addEventListener('input',up);up();One complete HTML file. Save it and open it in a browser.
<!doctype html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Bokeh Shape & Highlights — demo</title>
<style>
:root{--bg:#F1F1EF;--surface:#fff;--surface-2:#F7F7F5;--line:#E0E0DC;--text:#171717;--muted:#6f6f6f;--accent:#171717;--accent-ink:#fff;--danger:#d92d20}
*{box-sizing:border-box;margin:0}
html,body{height:100%}body{background:var(--bg);color:var(--text);font:15px/1.5 -apple-system,BlinkMacSystemFont,'Segoe UI',Inter,Roboto,sans-serif;-webkit-font-smoothing:antialiased}.stage{min-height:100%;display:grid;place-items:center;padding:24px}button,input,select,textarea{font-family:inherit}@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}}
.pre{display:flex;gap:5px;flex-wrap:wrap}.pre button{height:28px;padding:0 11px;border-radius:99px;border:1px solid var(--line);background:var(--surface);font-size:11px;cursor:pointer}
.pre button[aria-pressed=true]{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
.bx{width:min(330px,100%);display:grid;gap:9px}.rw{display:grid;gap:3px;font-size:11.5px;color:var(--muted)}.rw b{color:var(--text);font-weight:600}input[type=range]{width:100%;accent-color:#171717}
.out{font-size:12px;color:var(--muted);line-height:1.4}.out b{color:var(--text)}
button:focus-visible,input:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.sc{height:140px;border-radius:12px;position:relative;overflow:hidden;background:linear-gradient(#10131c,#1b1f2e)}
.sc i{position:absolute;display:block;transform:translate(-50%,-50%);background:radial-gradient(circle,rgba(255,255,255,.18),rgba(255,255,255,.55) 80%,rgba(255,255,255,.7));mix-blend-mode:screen}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
</style></head>
<body><div class="stage">
<div class="bx"><div class="sc" id="sc"></div><div class="pre" id="pre" role="group" aria-label="Shape"><button data-p="0" aria-pressed="true">Round</button><button data-p="1" aria-pressed="false">Hexagon</button><button data-p="2" aria-pressed="false">Star</button><button data-p="3" aria-pressed="false">Diamond</button></div><label class="rw">Aperture <b id="av">f/2.8</b><input id="ap" type="range" min="0" max="100" value="50"></label></div>
</div>
<script>
const SH=['circle(50%)','polygon(25% 5%,75% 5%,100% 50%,75% 95%,25% 95%,0 50%)','polygon(50% 0,61% 35%,98% 35%,68% 57%,79% 91%,50% 70%,21% 91%,32% 57%,2% 35%,39% 35%)','polygon(50% 0,100% 50%,50% 100%,0 50%)'],CC=['#ffb347','#ff8c5a','#7aa8ff','#ffd98a','#8ad0ff','#ff9ec4'],sc=document.getElementById('sc'),ap=document.getElementById('ap'),bs=[...document.querySelectorAll('#pre button')];let p=0;
let sd=5;const rnd=()=>(sd=(sd*1664525+1013904223)%4294967296)/4294967296;const pts=Array.from({length:14},()=>[rnd()*100,rnd()*100,CC[Math.floor(rnd()*CC.length)],.6+rnd()*.8]);
sc.innerHTML=pts.map(()=>'<i></i>').join('');const els=[...sc.children];
function up(){const a=+ap.value,sz=8+a*.5;els.forEach((e,i)=>{const q=pts[i],s=sz*q[3];e.style.cssText='left:'+q[0]+'%;top:'+q[1]+'%;width:'+s+'px;height:'+s+'px;clip-path:'+SH[p]+';background-color:'+q[2]+';opacity:'+(.85-a/100*.35).toFixed(2);});
document.getElementById('av').textContent='f/'+(8-a/100*6.6).toFixed(1);bs.forEach(b=>b.setAttribute('aria-pressed',String(+b.dataset.p===p)));}
bs.forEach(b=>b.addEventListener('click',()=>{p=+b.dataset.p;up();}));ap.addEventListener('input',up);up();
</script>
</body></html>