Aspect Ratio Frames
Five common aspect ratios as frames with typical uses, example pixel sizes and how to ask for them in a prompt.
AI prompt
Wide cinematic landscape of a lone lighthouse on a rocky headland at dusk, composed for a 16:9 frame with the lighthouse on the right third, a long empty horizon on the left filled with layered clouds and a soft orange glow, calm sea in the foreground, balanced negative space, 35mm lens, serene. State the ratio in the prompt as aspect ratio 16:9 or with the tool's ratio setting. Variants: the same scene recomposed for 9:16 with the lighthouse tall and centred, and for 1:1 with a tighter crop. Negative: stretched or distorted subject, cropped lighthouse top, text, watermark. Reduced motion: static image.About this pattern
Definition
Aspect ratio is the width to height ratio of an image. It changes the composition as much as the subject does, and most image tools let you ask for it in the prompt or settings. Choosing it first avoids cropping later and keeps the subject well framed.
When to use it
- 1:1 square: avatars, product tiles, album art.
- 4:5 portrait: Instagram feed posts.
- 16:9 landscape: video, slides, web banners.
- 9:16 tall: stories, reels, mobile wallpapers.
- 21:9 ultra-wide: cinema, hero banners.
What the controls do
- Five ratio buttons with a live frame.
Motion & timing
- The frame changes instantly.
- Reduced motion: nothing animates.
Tips & variations
- Compose for the ratio, not just crop to it: leave room for the subject to breathe.
- Generate at the target ratio rather than cropping a different one.
Code of this live preview
<div class="bx"><div class="pre" id="pre" role="group" aria-label="Aspect ratio"><button data-p="0" aria-pressed="true">16:9</button><button data-p="1" aria-pressed="false">1:1</button><button data-p="2" aria-pressed="false">4:5</button><button data-p="3" aria-pressed="false">9:16</button><button data-p="4" aria-pressed="false">21:9</button></div><div class="bd"><div class="fr" id="fr"><i class="sn"></i><i class="lh"></i><i class="gr"></i></div></div><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}
.bd{height:140px;display:grid;place-items:center;border-radius:12px;background:var(--pv)}.fr{height:var(--h);aspect-ratio:var(--r);max-width:96%;max-height:130px;border-radius:6px;position:relative;overflow:hidden;background:linear-gradient(#2a3b66,#f2a65a 75%);box-shadow:0 3px 10px rgba(0,0,0,.2)}.fr i{position:absolute;display:block}.sn{left:24%;bottom:26%;width:22%;aspect-ratio:1;border-radius:50%;background:#ffe3a8;opacity:.7;filter:blur(6px)}.lh{left:66%;bottom:18%;width:8%;height:42%;background:#f4f4f0;clip-path:polygon(20% 0,80% 0,100% 100%,0 100%)}.gr{left:0;right:0;bottom:0;height:20%;background:#1c2438}.out{font-size:12px;color:var(--muted);line-height:1.4}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}const R=[[16/9,'1792 x 1008','Video, slides, web banners.'],[1,'1024 x 1024','Avatars, product tiles, album art.'],[.8,'1080 x 1350','Instagram feed posts.'],[9/16,'1080 x 1920','Stories, reels, phone wallpapers.'],[21/9,'2560 x 1097','Cinema, ultra-wide hero banners.']],N=['16:9','1:1','4:5','9:16','21:9'],fr=document.getElementById('fr'),bs=[...document.querySelectorAll('#pre button')];let p=0;
function up(){fr.style.setProperty('--r',R[p][0]);fr.style.setProperty('--h','130px');document.getElementById('out').textContent=N[p]+' ('+R[p][1]+'): '+R[p][2]+' Prompt: aspect ratio '+N[p]+'.';bs.forEach(b=>b.setAttribute('aria-pressed',String(+b.dataset.p===p)));}
bs.forEach(b=>b.addEventListener('click',()=>{p=+b.dataset.p;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>Aspect Ratio Frames — 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}
.bd{height:140px;display:grid;place-items:center;border-radius:12px;background:var(--pv)}.fr{height:var(--h);aspect-ratio:var(--r);max-width:96%;max-height:130px;border-radius:6px;position:relative;overflow:hidden;background:linear-gradient(#2a3b66,#f2a65a 75%);box-shadow:0 3px 10px rgba(0,0,0,.2)}.fr i{position:absolute;display:block}.sn{left:24%;bottom:26%;width:22%;aspect-ratio:1;border-radius:50%;background:#ffe3a8;opacity:.7;filter:blur(6px)}.lh{left:66%;bottom:18%;width:8%;height:42%;background:#f4f4f0;clip-path:polygon(20% 0,80% 0,100% 100%,0 100%)}.gr{left:0;right:0;bottom:0;height:20%;background:#1c2438}.out{font-size:12px;color:var(--muted);line-height:1.4}
@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="Aspect ratio"><button data-p="0" aria-pressed="true">16:9</button><button data-p="1" aria-pressed="false">1:1</button><button data-p="2" aria-pressed="false">4:5</button><button data-p="3" aria-pressed="false">9:16</button><button data-p="4" aria-pressed="false">21:9</button></div><div class="bd"><div class="fr" id="fr"><i class="sn"></i><i class="lh"></i><i class="gr"></i></div></div><p class="out" id="out"></p></div>
</div>
<script>
const R=[[16/9,'1792 x 1008','Video, slides, web banners.'],[1,'1024 x 1024','Avatars, product tiles, album art.'],[.8,'1080 x 1350','Instagram feed posts.'],[9/16,'1080 x 1920','Stories, reels, phone wallpapers.'],[21/9,'2560 x 1097','Cinema, ultra-wide hero banners.']],N=['16:9','1:1','4:5','9:16','21:9'],fr=document.getElementById('fr'),bs=[...document.querySelectorAll('#pre button')];let p=0;
function up(){fr.style.setProperty('--r',R[p][0]);fr.style.setProperty('--h','130px');document.getElementById('out').textContent=N[p]+' ('+R[p][1]+'): '+R[p][2]+' Prompt: aspect ratio '+N[p]+'.';bs.forEach(b=>b.setAttribute('aria-pressed',String(+b.dataset.p===p)));}
bs.forEach(b=>b.addEventListener('click',()=>{p=+b.dataset.p;up();}));up();
</script>
</body></html>