Colour Correction Compare
Drag the divider between a flat dull photo and a corrected one; tune exposure, contrast and warmth on the right.
AI prompt
Corrected version of a flat, underexposed street portrait: exposure raised by plus 0.7 stops, contrast increased moderately, warmth shifted slightly toward amber, deep clean blacks, bright but not clipped highlights, natural skin tones, subtle vignette, sharp eyes, photographic realism. Before version: dull, grey, slightly blue cast, low contrast, muddy shadows. Describe corrections in measurable terms (plus 0.7 stops, plus 15 contrast, plus 10 warmth). Negative: crushed blacks, clipped highlights, orange skin, over-sharpening, HDR halos.About this pattern
Definition
A before and after compare puts the original and the edited version in one frame with a draggable divider so the effect of each correction is obvious.
When to use it
- Shows what exposure, contrast and warmth actually do, one control at a time.
- Useful for retouching tutorials, product pages and prompt guides that explain correction words.
- Keep adjustments modest; heavy correction looks processed.
What the controls do
- Compare slider moves the divider; Exposure, Contrast and Warmth sliders change only the After side; Reset restores the start.
Motion & timing
- Divider follows the pointer without easing; filters update live.
- Reduced motion: no difference.
Tips & variations
- The divider works with mouse, touch and keyboard (arrow keys on the slider).
- Labels stay inside the frame at every width.
Code of this live preview
<div class="bx"><div class="cmp" id="cmp"><div class="im be"></div><div class="im af" id="af"></div><i class="dv" aria-hidden="true"></i><span class="tg l">Before</span><span class="tg r">After</span></div>
<label class="ctl">Compare <input id="pos" type="range" min="0" max="100" value="50" aria-label="Divider"></label>
<div class="g"><label>Exposure <input id="ex" type="range" min="-30" max="60" value="30"></label><label>Contrast <input id="co" type="range" min="-20" max="60" value="25"></label><label>Warmth <input id="wa" type="range" min="-30" max="40" value="15"></label></div><button id="rs" type="button">Reset</button></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}
.bx{width:min(300px,100%);display:grid;gap:8px}
.cmp{position:relative;height:130px;border-radius:12px;overflow:hidden;background:#999;touch-action:none}
.im{position:absolute;inset:0;background:linear-gradient(#a9b4c0,#c4c8c8 55%,#7c8288 55%);filter:brightness(.85) contrast(.8) saturate(.7)}
.im::before{content:"";position:absolute;left:50%;top:28px;width:34px;height:34px;margin-left:-17px;border-radius:50%;background:#c9a58a}
.im::after{content:"";position:absolute;left:50%;top:64px;width:70px;height:70px;margin-left:-35px;border-radius:30px 30px 0 0;background:#4d5663}
.af{clip-path:inset(0 0 0 var(--p,50%));filter:brightness(var(--b,1.2)) contrast(var(--c,1.1)) sepia(var(--s,.1)) saturate(.9)}
.dv{position:absolute;top:0;bottom:0;left:var(--p,50%);width:2px;margin-left:-1px;background:#fff;box-shadow:0 0 0 1px rgba(0,0,0,.2)}
.tg{position:absolute;top:6px;font-size:10.5px;background:rgba(255,255,255,.88);padding:1px 8px;border-radius:99px}.tg.l{left:6px}.tg.r{right:6px}
.ctl,.g label{display:grid;gap:3px;font-size:11.5px;color:var(--muted)}.g{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
input[type=range]{width:100%;accent-color:#171717}
#rs{height:28px;border-radius:99px;border:1px solid var(--line);background:var(--surface);font:inherit;font-size:12px;cursor:pointer}
input:focus-visible,button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
@media (prefers-reduced-motion:reduce){*{transition:none}}const $=id=>document.getElementById(id),cmp=$('cmp'),af=$('af'),pos=$('pos'),ex=$('ex'),co=$('co'),wa=$('wa');
function up(){af.style.setProperty('--b',(1+ex.value/100).toFixed(2));af.style.setProperty('--c',(1+co.value/100).toFixed(2));af.style.setProperty('--s',(Math.max(0,wa.value)/100).toFixed(2));af.style.filter='brightness('+(1+ex.value/100)+') contrast('+(1+co.value/100)+') sepia('+(Math.max(0,wa.value)/100)+') hue-rotate('+(Math.min(0,wa.value)*.6)+'deg) saturate(.9)';}
[ex,co,wa].forEach(e=>e.addEventListener('input',up));pos.addEventListener('input',()=>cmp.style.setProperty('--p',pos.value+'%'));
let d=false;const mv=e=>{const r=cmp.getBoundingClientRect(),p=Math.max(0,Math.min(100,(e.clientX-r.left)/r.width*100));pos.value=p;cmp.style.setProperty('--p',p+'%');};
cmp.addEventListener('pointerdown',e=>{d=true;cmp.setPointerCapture(e.pointerId);mv(e);});cmp.addEventListener('pointermove',e=>{if(d)mv(e);});cmp.addEventListener('pointerup',()=>d=false);cmp.addEventListener('pointercancel',()=>d=false);
$('rs').addEventListener('click',()=>{ex.value=30;co.value=25;wa.value=15;pos.value=50;cmp.style.setProperty('--p','50%');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>Colour Correction Compare — 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}}
.bx{width:min(300px,100%);display:grid;gap:8px}
.cmp{position:relative;height:130px;border-radius:12px;overflow:hidden;background:#999;touch-action:none}
.im{position:absolute;inset:0;background:linear-gradient(#a9b4c0,#c4c8c8 55%,#7c8288 55%);filter:brightness(.85) contrast(.8) saturate(.7)}
.im::before{content:"";position:absolute;left:50%;top:28px;width:34px;height:34px;margin-left:-17px;border-radius:50%;background:#c9a58a}
.im::after{content:"";position:absolute;left:50%;top:64px;width:70px;height:70px;margin-left:-35px;border-radius:30px 30px 0 0;background:#4d5663}
.af{clip-path:inset(0 0 0 var(--p,50%));filter:brightness(var(--b,1.2)) contrast(var(--c,1.1)) sepia(var(--s,.1)) saturate(.9)}
.dv{position:absolute;top:0;bottom:0;left:var(--p,50%);width:2px;margin-left:-1px;background:#fff;box-shadow:0 0 0 1px rgba(0,0,0,.2)}
.tg{position:absolute;top:6px;font-size:10.5px;background:rgba(255,255,255,.88);padding:1px 8px;border-radius:99px}.tg.l{left:6px}.tg.r{right:6px}
.ctl,.g label{display:grid;gap:3px;font-size:11.5px;color:var(--muted)}.g{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
input[type=range]{width:100%;accent-color:#171717}
#rs{height:28px;border-radius:99px;border:1px solid var(--line);background:var(--surface);font:inherit;font-size:12px;cursor:pointer}
input:focus-visible,button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
@media (prefers-reduced-motion:reduce){*{transition:none}}
</style></head>
<body><div class="stage">
<div class="bx"><div class="cmp" id="cmp"><div class="im be"></div><div class="im af" id="af"></div><i class="dv" aria-hidden="true"></i><span class="tg l">Before</span><span class="tg r">After</span></div>
<label class="ctl">Compare <input id="pos" type="range" min="0" max="100" value="50" aria-label="Divider"></label>
<div class="g"><label>Exposure <input id="ex" type="range" min="-30" max="60" value="30"></label><label>Contrast <input id="co" type="range" min="-20" max="60" value="25"></label><label>Warmth <input id="wa" type="range" min="-30" max="40" value="15"></label></div><button id="rs" type="button">Reset</button></div>
</div>
<script>
const $=id=>document.getElementById(id),cmp=$('cmp'),af=$('af'),pos=$('pos'),ex=$('ex'),co=$('co'),wa=$('wa');
function up(){af.style.setProperty('--b',(1+ex.value/100).toFixed(2));af.style.setProperty('--c',(1+co.value/100).toFixed(2));af.style.setProperty('--s',(Math.max(0,wa.value)/100).toFixed(2));af.style.filter='brightness('+(1+ex.value/100)+') contrast('+(1+co.value/100)+') sepia('+(Math.max(0,wa.value)/100)+') hue-rotate('+(Math.min(0,wa.value)*.6)+'deg) saturate(.9)';}
[ex,co,wa].forEach(e=>e.addEventListener('input',up));pos.addEventListener('input',()=>cmp.style.setProperty('--p',pos.value+'%'));
let d=false;const mv=e=>{const r=cmp.getBoundingClientRect(),p=Math.max(0,Math.min(100,(e.clientX-r.left)/r.width*100));pos.value=p;cmp.style.setProperty('--p',p+'%');};
cmp.addEventListener('pointerdown',e=>{d=true;cmp.setPointerCapture(e.pointerId);mv(e);});cmp.addEventListener('pointermove',e=>{if(d)mv(e);});cmp.addEventListener('pointerup',()=>d=false);cmp.addEventListener('pointercancel',()=>d=false);
$('rs').addEventListener('click',()=>{ex.value=30;co.value=25;wa.value=15;pos.value=50;cmp.style.setProperty('--p','50%');up();});up();
</script>
</body></html>