Cut-Out Edge Feather Compare
A subject cut from its background shown with a hard edge, a feathered edge and a bad halo, on a transparency grid.
AI prompt
Product comparison image of a potted plant cut out from its photo and placed on a dark grey background in three versions side by side: a hard-edged mask with a jagged outline, a softly feathered mask that blends naturally, and a version with a visible white halo of leftover background around the leaves, studio lighting, labelled beneath, clean grid layout, no other objects. Negative: a different plant in each version, text errors, heavy blur, drop shadows. Reduced motion: static comparison.About this pattern
Definition
When a subject is cut out, the quality of the edge decides whether it looks real when placed on a new background. A hard edge looks pasted, a slightly feathered edge blends in, and a halo of leftover background colour gives the cut away immediately.
When to use it
- Compare on the new background, not on white, where halos hide.
- Feather by one or two pixels, not more; large feathers look blurry.
- Check hair and transparent areas; they need a soft matte, not a hard mask.
What the controls do
- Four views (Original, Hard cut, Feathered, Halo) and a Feather slider.
Motion & timing
- Views change instantly.
- Reduced motion: nothing to change.
Tips & variations
- Preview on both a light and a dark background before accepting a cut-out.
- Keep the original so the mask can be redone.
Code of this live preview
<div class="bx"><div class="sc" id="sc" data-m="orig"><div class="bg"></div><div class="sj" id="sj"></div></div><div class="pre" id="pre" role="group" aria-label="View"><button data-p="0" aria-pressed="true">Original</button><button data-p="1" aria-pressed="false">Hard cut</button><button data-p="2" aria-pressed="false">Feathered</button><button data-p="3" aria-pressed="false">Halo</button></div><label class="rw">Feather <b id="fv">2px</b><input id="fe" type="range" min="0" max="8" step=".5" value="2"></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:#fff}.bg{position:absolute;inset:0;background:linear-gradient(#9fd3f2,#e9f6fb 60%,#8cc46a 60%)}
.sj{position:absolute;left:50%;top:50%;width:70px;height:92px;margin:-46px 0 0 -35px;background:radial-gradient(circle at 50% 26%,#e4b896 0 15px,transparent 16px),linear-gradient(#3f5d8a,#3f5d8a) 50% 100%/62px 52px no-repeat;border-radius:50%/40% 40% 50% 50%}
.sc[data-m=orig] .bg{background:linear-gradient(#9fd3f2,#e9f6fb 60%,#8cc46a 60%)}
.sc:not([data-m=orig]) .bg{background:repeating-conic-gradient(#d0d0d0 0 25%,#fff 0 50%) 0 0/16px 16px}
.sc[data-m=feather] .sj{filter:blur(calc(var(--f)*.45))}.sc[data-m=halo] .sj{filter:drop-shadow(2.5px 0 0 #bfe6a8) drop-shadow(-2.5px 0 0 #bfe6a8) drop-shadow(0 2.5px 0 #cfeaf8) drop-shadow(0 -2.5px 0 #cfeaf8)}
.sc[data-m=hard] .sj{filter:none}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}const M=['orig','hard','feather','halo'],sc=document.getElementById('sc'),fe=document.getElementById('fe'),bs=[...document.querySelectorAll('#pre button')];let p=0;
function up(){sc.dataset.m=M[p];sc.style.setProperty('--f',fe.value+'px');fe.disabled=p!==2;document.getElementById('fv').textContent=fe.value+'px';bs.forEach(b=>b.setAttribute('aria-pressed',String(+b.dataset.p===p)));}
bs.forEach(b=>b.addEventListener('click',()=>{p=+b.dataset.p;up();}));fe.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>Cut-Out Edge Feather 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}
.sc{height:140px;border-radius:12px;position:relative;overflow:hidden;background:#fff}.bg{position:absolute;inset:0;background:linear-gradient(#9fd3f2,#e9f6fb 60%,#8cc46a 60%)}
.sj{position:absolute;left:50%;top:50%;width:70px;height:92px;margin:-46px 0 0 -35px;background:radial-gradient(circle at 50% 26%,#e4b896 0 15px,transparent 16px),linear-gradient(#3f5d8a,#3f5d8a) 50% 100%/62px 52px no-repeat;border-radius:50%/40% 40% 50% 50%}
.sc[data-m=orig] .bg{background:linear-gradient(#9fd3f2,#e9f6fb 60%,#8cc46a 60%)}
.sc:not([data-m=orig]) .bg{background:repeating-conic-gradient(#d0d0d0 0 25%,#fff 0 50%) 0 0/16px 16px}
.sc[data-m=feather] .sj{filter:blur(calc(var(--f)*.45))}.sc[data-m=halo] .sj{filter:drop-shadow(2.5px 0 0 #bfe6a8) drop-shadow(-2.5px 0 0 #bfe6a8) drop-shadow(0 2.5px 0 #cfeaf8) drop-shadow(0 -2.5px 0 #cfeaf8)}
.sc[data-m=hard] .sj{filter:none}
@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" data-m="orig"><div class="bg"></div><div class="sj" id="sj"></div></div><div class="pre" id="pre" role="group" aria-label="View"><button data-p="0" aria-pressed="true">Original</button><button data-p="1" aria-pressed="false">Hard cut</button><button data-p="2" aria-pressed="false">Feathered</button><button data-p="3" aria-pressed="false">Halo</button></div><label class="rw">Feather <b id="fv">2px</b><input id="fe" type="range" min="0" max="8" step=".5" value="2"></label></div>
</div>
<script>
const M=['orig','hard','feather','halo'],sc=document.getElementById('sc'),fe=document.getElementById('fe'),bs=[...document.querySelectorAll('#pre button')];let p=0;
function up(){sc.dataset.m=M[p];sc.style.setProperty('--f',fe.value+'px');fe.disabled=p!==2;document.getElementById('fv').textContent=fe.value+'px';bs.forEach(b=>b.setAttribute('aria-pressed',String(+b.dataset.p===p)));}
bs.forEach(b=>b.addEventListener('click',()=>{p=+b.dataset.p;up();}));fe.addEventListener('input',up);up();
</script>
</body></html>