Resolution & Upscale Compare
Drag a divider to compare the same image at a few dozen pixels wide against a sharp version.
AI prompt
Side-by-side comparison of the same illustrated badge with a bold letter A inside a circle: left half low resolution at 32 pixels wide, visibly blocky with stair-stepped edges and lost thin lines, right half crisp at full resolution with smooth curves and fine detail, a thin white vertical divider in the middle, labelled Before and After, neutral background. Variants: 64 and 128 pixel versions. Negative: different crops, colour differences, blur, text errors. Reduced motion: static comparison.About this pattern
Definition
A low-resolution image enlarged shows blocky pixels and lost detail. Upscaling tools try to rebuild edges and fine texture. A wipe comparison with a draggable divider shows exactly what was lost and what came back.
When to use it
- Use the same crop and zoom on both sides; any difference then comes from resolution alone.
- Look at edges, thin lines and text first; they fail soonest.
- In prompts, ask for the final resolution you need and the level of detail, not just upscale.
What the controls do
- A Position slider that moves the divider, plus three resolution presets (32, 64, 128 px).
Motion & timing
- The divider follows the slider directly.
- Reduced motion: nothing animates.
Tips & variations
- Provide the keyboard slider as the main control; dragging is secondary.
- Label the two sides so the comparison is never ambiguous.
Code of this live preview
<div class="bx"><div class="cmp" id="cmp"><canvas id="hi" width="300" height="150"></canvas><canvas id="lo" width="32" height="16"></canvas><span class="dv" id="dv"></span><b class="tg l">Before</b><b class="tg r">After</b></div><label class="rw">Divider <b id="pv">50%</b><input id="ps" type="range" min="0" max="100" value="50"></label><div class="pre" id="pre" role="group" aria-label="Low resolution"><button data-p="0" aria-pressed="true">32 px</button><button data-p="1" aria-pressed="false">64 px</button><button data-p="2" aria-pressed="false">128 px</button></div></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}
.cmp{height:150px;position:relative;border-radius:12px;overflow:hidden;background:#fff;border:1px solid var(--line)}.cmp canvas{position:absolute;left:0;top:0;width:100%;height:100%}
#lo{image-rendering:pixelated;clip-path:inset(0 calc(100% - var(--x)*1%) 0 0)}.dv{position:absolute;top:0;bottom:0;width:2px;background:#fff;box-shadow:0 0 0 1px rgba(0,0,0,.2);left:calc(var(--x)*1%)}
.tg{position:absolute;bottom:6px;font-size:10px;padding:2px 7px;border-radius:99px;background:rgba(0,0,0,.6);color:#fff;font-weight:600}.tg.l{left:6px}.tg.r{right:6px}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}const W=[32,64,128],cmp=document.getElementById('cmp'),hi=document.getElementById('hi'),lo=document.getElementById('lo'),ps=document.getElementById('ps'),bs=[...document.querySelectorAll('#pre button')];let p=0;
function draw(c,w,h){const x=c.getContext('2d'),s=w/300;x.setTransform(s,0,0,s,0,0);x.clearRect(0,0,300,150);x.fillStyle='#f7f2e6';x.fillRect(0,0,300,150);x.fillStyle='#ff6f61';x.beginPath();x.arc(150,75,62,0,7);x.fill();x.fillStyle='#fff';x.font='bold 84px Arial,sans-serif';x.textAlign='center';x.textBaseline='middle';x.fillText('A',150,80);x.strokeStyle='#2b2b2b';x.lineWidth=1.2;x.beginPath();for(let i=0;i<6;i++){x.moveTo(20,20+i*6);x.lineTo(70,20+i*6);}x.stroke();x.fillStyle='#2b59d6';for(let i=0;i<4;i++){x.fillRect(235+i*10,110-i*12,6,6+i*12);}}
function up(){cmp.style.setProperty('--x',ps.value);document.getElementById('pv').textContent=ps.value+'%';}
function res(){const w=W[p];lo.width=w;lo.height=Math.round(w/2);draw(lo,w,w/2);bs.forEach(b=>b.setAttribute('aria-pressed',String(+b.dataset.p===p)));}
draw(hi,300,150);bs.forEach(b=>b.addEventListener('click',()=>{p=+b.dataset.p;res();}));ps.addEventListener('input',up);res();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>Resolution & Upscale 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}}
.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}
.cmp{height:150px;position:relative;border-radius:12px;overflow:hidden;background:#fff;border:1px solid var(--line)}.cmp canvas{position:absolute;left:0;top:0;width:100%;height:100%}
#lo{image-rendering:pixelated;clip-path:inset(0 calc(100% - var(--x)*1%) 0 0)}.dv{position:absolute;top:0;bottom:0;width:2px;background:#fff;box-shadow:0 0 0 1px rgba(0,0,0,.2);left:calc(var(--x)*1%)}
.tg{position:absolute;bottom:6px;font-size:10px;padding:2px 7px;border-radius:99px;background:rgba(0,0,0,.6);color:#fff;font-weight:600}.tg.l{left:6px}.tg.r{right:6px}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
</style></head>
<body><div class="stage">
<div class="bx"><div class="cmp" id="cmp"><canvas id="hi" width="300" height="150"></canvas><canvas id="lo" width="32" height="16"></canvas><span class="dv" id="dv"></span><b class="tg l">Before</b><b class="tg r">After</b></div><label class="rw">Divider <b id="pv">50%</b><input id="ps" type="range" min="0" max="100" value="50"></label><div class="pre" id="pre" role="group" aria-label="Low resolution"><button data-p="0" aria-pressed="true">32 px</button><button data-p="1" aria-pressed="false">64 px</button><button data-p="2" aria-pressed="false">128 px</button></div></div>
</div>
<script>
const W=[32,64,128],cmp=document.getElementById('cmp'),hi=document.getElementById('hi'),lo=document.getElementById('lo'),ps=document.getElementById('ps'),bs=[...document.querySelectorAll('#pre button')];let p=0;
function draw(c,w,h){const x=c.getContext('2d'),s=w/300;x.setTransform(s,0,0,s,0,0);x.clearRect(0,0,300,150);x.fillStyle='#f7f2e6';x.fillRect(0,0,300,150);x.fillStyle='#ff6f61';x.beginPath();x.arc(150,75,62,0,7);x.fill();x.fillStyle='#fff';x.font='bold 84px Arial,sans-serif';x.textAlign='center';x.textBaseline='middle';x.fillText('A',150,80);x.strokeStyle='#2b2b2b';x.lineWidth=1.2;x.beginPath();for(let i=0;i<6;i++){x.moveTo(20,20+i*6);x.lineTo(70,20+i*6);}x.stroke();x.fillStyle='#2b59d6';for(let i=0;i<4;i++){x.fillRect(235+i*10,110-i*12,6,6+i*12);}}
function up(){cmp.style.setProperty('--x',ps.value);document.getElementById('pv').textContent=ps.value+'%';}
function res(){const w=W[p];lo.width=w;lo.height=Math.round(w/2);draw(lo,w,w/2);bs.forEach(b=>b.setAttribute('aria-pressed',String(+b.dataset.p===p)));}
draw(hi,300,150);bs.forEach(b=>b.addEventListener('click',()=>{p=+b.dataset.p;res();}));ps.addEventListener('input',up);res();up();
</script>
</body></html>