Moonlight & Night Exposure
A night landscape under a new, half or full moon: raise exposure to reveal detail and watch stars fade and noise grow.
AI prompt
Night landscape photograph of a mountain lake under a bright full moon, soft cool blue light on the water and pine trees, a few bright stars still visible in the deep navy sky, subtle silvery reflections, fine low grain, long exposure with perfectly smooth water, foreground silhouettes with detail visible in the shadows, 20mm lens, quiet and magical. Variants: new moon with a dense Milky Way over almost black land, and a half moon with dimmer light. Negative: day-for-night orange glow, heavy noise, star trails, text, watermark. Reduced motion: static image.About this pattern
Definition
Moonlight is sunlight reflected, about a million times dimmer than day. A full moon gives a faint cool light that a camera can still record with long exposure; a new moon leaves only starlight. More exposure reveals the land but also fades the stars and adds noise at high ISO.
When to use it
- Full moon: strong enough for a landscape with soft blue shadows; stars dim.
- Half moon: about a quarter of the light of a full moon.
- New moon: only stars and the Milky Way; the ground is almost black.
- Each stop of exposure doubles the light; the cost is longer exposure, wider aperture or noise.
What the controls do
- Three moon buttons and an Exposure slider in stops.
Motion & timing
- Updates follow the controls.
- Reduced motion: nothing animates.
Tips & variations
- Use a tripod and keep exposure under about 20 seconds before stars trail.
- Balance the ground and the sky; over-brightening makes a day-for-night look.
Code of this live preview
<div class="bx"><div class="pre" id="pre" role="group" aria-label="Moon"><button data-p="0" aria-pressed="true">Full moon</button><button data-p="1" aria-pressed="false">Half moon</button><button data-p="2" aria-pressed="false">New moon</button></div><div class="sc" id="sc"><div class="st" id="st"></div><i class="mn"></i><i class="mt"></i><i class="lk"></i><b class="nz"></b></div><label class="rw">Exposure <b id="ev">+0 stops</b><input id="ex" type="range" min="-20" max="40" value="0"></label><p class="out" id="out"></p></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}
button{font:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer}a{color:inherit;text-decoration:none}ul,ol,p,h4{margin:0;padding:0}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.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:122px;border-radius:12px;position:relative;overflow:hidden;background:linear-gradient(#050a1c,#16264a);filter:brightness(var(--b))}.sc i,.sc b{position:absolute;display:block}.mn{right:16%;top:12%;width:20px;height:20px;border-radius:50%;background:var(--mc);box-shadow:0 0 20px 6px var(--mg)}.mt{left:-4%;right:-4%;bottom:26%;height:34%;background:#0b1326;clip-path:polygon(0 100%,0 62%,22% 20%,42% 58%,66% 8%,100% 60%,100% 100%)}.lk{left:0;right:0;bottom:0;height:28%;background:linear-gradient(#1e3158,#0e1a33)}.st{position:absolute;inset:0;opacity:var(--so)}.st i{width:2px;height:2px;border-radius:50%;background:#fff;position:absolute}.nz{inset:0;opacity:var(--no);background-image:radial-gradient(rgba(255,255,255,.55) 1px,transparent 1.2px),radial-gradient(rgba(0,0,0,.5) 1px,transparent 1.2px);background-size:3px 3px,4px 4px;mix-blend-mode:overlay}.out{font-size:12px;color:var(--muted);min-height:34px}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}const M=[[1,'#f4f1dd','rgba(230,235,255,.6)'],[.25,'#c8cadb','rgba(200,210,240,.3)'],[.02,'transparent','transparent']],sc=document.getElementById('sc'),st=document.getElementById('st'),ex=document.getElementById('ex'),bs=[...document.querySelectorAll('#pre button')];let p=0,s=5;const r=()=>(s=(s*1664525+1013904223)%4294967296)/4294967296;
st.innerHTML=Array.from({length:46},()=>'<i style="left:'+(r()*100).toFixed(1)+'%;top:'+(r()*55).toFixed(1)+'%"></i>').join('');
function up(){const e=ex.value/10,L=M[p][0]*Math.pow(2,e),b=Math.max(.35,Math.min(1.7,Math.pow(L,.28)*.95+.05));sc.style.setProperty('--b',b.toFixed(2));sc.style.setProperty('--mc',M[p][1]);sc.style.setProperty('--mg',M[p][2]);sc.style.setProperty('--so',Math.max(.05,Math.min(1,1.1-Math.pow(L,.5)*.35)).toFixed(2));sc.style.setProperty('--no',Math.max(0,Math.min(.5,(e-1.5)*.18)).toFixed(2));
document.getElementById('ev').textContent=(e>=0?'+':'')+e.toFixed(1)+' stops';document.getElementById('out').textContent=L<.04?'Too dark: only stars read. Add exposure or wait for a brighter moon.':L>12?'Overexposed: it looks like day, the stars have disappeared.':e>2.5?'Bright, with visible noise from high ISO or long exposure.':'Natural moonlit look: cool light, some stars remain.';bs.forEach(b=>b.setAttribute('aria-pressed',String(+b.dataset.p===p)));}
bs.forEach(b=>b.addEventListener('click',()=>{p=+b.dataset.p;up();}));ex.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>Moonlight & Night Exposure — 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}}
button{font:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer}a{color:inherit;text-decoration:none}ul,ol,p,h4{margin:0;padding:0}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.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:122px;border-radius:12px;position:relative;overflow:hidden;background:linear-gradient(#050a1c,#16264a);filter:brightness(var(--b))}.sc i,.sc b{position:absolute;display:block}.mn{right:16%;top:12%;width:20px;height:20px;border-radius:50%;background:var(--mc);box-shadow:0 0 20px 6px var(--mg)}.mt{left:-4%;right:-4%;bottom:26%;height:34%;background:#0b1326;clip-path:polygon(0 100%,0 62%,22% 20%,42% 58%,66% 8%,100% 60%,100% 100%)}.lk{left:0;right:0;bottom:0;height:28%;background:linear-gradient(#1e3158,#0e1a33)}.st{position:absolute;inset:0;opacity:var(--so)}.st i{width:2px;height:2px;border-radius:50%;background:#fff;position:absolute}.nz{inset:0;opacity:var(--no);background-image:radial-gradient(rgba(255,255,255,.55) 1px,transparent 1.2px),radial-gradient(rgba(0,0,0,.5) 1px,transparent 1.2px);background-size:3px 3px,4px 4px;mix-blend-mode:overlay}.out{font-size:12px;color:var(--muted);min-height:34px}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
</style></head>
<body><div class="stage">
<div class="bx"><div class="pre" id="pre" role="group" aria-label="Moon"><button data-p="0" aria-pressed="true">Full moon</button><button data-p="1" aria-pressed="false">Half moon</button><button data-p="2" aria-pressed="false">New moon</button></div><div class="sc" id="sc"><div class="st" id="st"></div><i class="mn"></i><i class="mt"></i><i class="lk"></i><b class="nz"></b></div><label class="rw">Exposure <b id="ev">+0 stops</b><input id="ex" type="range" min="-20" max="40" value="0"></label><p class="out" id="out"></p></div>
</div>
<script>
const M=[[1,'#f4f1dd','rgba(230,235,255,.6)'],[.25,'#c8cadb','rgba(200,210,240,.3)'],[.02,'transparent','transparent']],sc=document.getElementById('sc'),st=document.getElementById('st'),ex=document.getElementById('ex'),bs=[...document.querySelectorAll('#pre button')];let p=0,s=5;const r=()=>(s=(s*1664525+1013904223)%4294967296)/4294967296;
st.innerHTML=Array.from({length:46},()=>'<i style="left:'+(r()*100).toFixed(1)+'%;top:'+(r()*55).toFixed(1)+'%"></i>').join('');
function up(){const e=ex.value/10,L=M[p][0]*Math.pow(2,e),b=Math.max(.35,Math.min(1.7,Math.pow(L,.28)*.95+.05));sc.style.setProperty('--b',b.toFixed(2));sc.style.setProperty('--mc',M[p][1]);sc.style.setProperty('--mg',M[p][2]);sc.style.setProperty('--so',Math.max(.05,Math.min(1,1.1-Math.pow(L,.5)*.35)).toFixed(2));sc.style.setProperty('--no',Math.max(0,Math.min(.5,(e-1.5)*.18)).toFixed(2));
document.getElementById('ev').textContent=(e>=0?'+':'')+e.toFixed(1)+' stops';document.getElementById('out').textContent=L<.04?'Too dark: only stars read. Add exposure or wait for a brighter moon.':L>12?'Overexposed: it looks like day, the stars have disappeared.':e>2.5?'Bright, with visible noise from high ISO or long exposure.':'Natural moonlit look: cool light, some stars remain.';bs.forEach(b=>b.setAttribute('aria-pressed',String(+b.dataset.p===p)));}
bs.forEach(b=>b.addEventListener('click',()=>{p=+b.dataset.p;up();}));ex.addEventListener('input',up);up();
</script>
</body></html>