HTML/CSS Thumbnail & OG Maker
Enter a title and subtitle to generate resolution-specific HTML/CSS code for blog thumbnails and OG social cards ready for instant browser capture or rendering. Padding ratios and contrast rules are defined in SKILL.md, with rendered examples included.
When to use it
For content teams producing recurring article thumbnails and social share images to one brand spec.
File specifications
| File Info | html-thumbnail-maker.zip · 15KB |
|---|---|
| Included files | SKILL.md · assets/object-hero.html · assets/title-hero.html · scripts/shot.py |
| Format | Agent Skill (SKILL.md · ZIP) |
Full SKILL.md Specification151lines
---name: html-thumbnail-makerdescription: Creates thumbnails and OG images (1200×630, 1200×600) from a single HTML/CSS file and captures them as PNGs using headless Chrome. Applies composition formulas (Title-Hero / Object-Hero), two-line Korean title blocks, 320px downscale legibility, KakaoTalk 2:1 preview safety (core elements within the center 80%), margin balance and overlap checks, and 5–15° object tilt, using scripts/shot.py for capture and layout inspection. Always use this skill when the user asks for a "thumbnail", "OG image", "featured image", "blog thumbnail", "social share image", "link preview image", "KakaoTalk share image", "og:image", or "YouTube/newsletter cover in HTML", or provides an article/page title and wants a single image. Especially suited for environments without an image generation model or images that require crisp, accurate Korean typography.compatibility: Environment with Python 3 and Chrome, Chromium, or Edge installed (code execution enabled)--- # HTML Thumbnail Maker Thumbnails are **viewed small**—around 320px wide in messaging apps, and even smaller in search results. The most common failure is designing an image that looks great at 1200px, only for the text to collapse into an unreadable blur when scaled down. Rather than chasing decorative polish, this skill prioritizes a disciplined verification loop—using layout metrics and downscaled previews to confirm that **the title stays legible when shrunk and the core message survives cropping**. Why build in HTML: Korean typography renders with pixel-accurate fidelity, adjustments take a single number change, and actual element bounding boxes can be inspected programmatically for overlap and imbalance. ## Workflow 1. Choose size and layout → 2. Craft a two-line title block → 3. Write the HTML → 4. Capture + run layout checks → 5. Visually inspect the proof sheet → 6. Fix and repeat (steps 4–5) → 7. Deliver Never skip steps 4–5 and declare the task finished. Deliver only after opening and visually inspecting the rendered image. ## 1. Size and Layout **Dimensions**: Default to `1200×630` (OG standard). Use `1200×600` when a 2:1 ratio is required (certain social cards or explicit 2:1 requests). Following the "center 80%" rule below ensures either aspect ratio survives cropping cleanly. **Choose one of two compositions.** Never mix them. | | Title-Hero | Object-Hero ||---|---|---|| When to use | The title itself drives curiosity, there is no obvious visual object, or the title is number-/question-driven | A recognizable object communicates the topic at a glance (receipt, calendar, calculator, box, phone screen) || Arrangement | Title block centered horizontally and vertically; spans 55–80% of canvas width | Text on the left (~45% width) + object on the right (~33% width), with at least a 40px gap between them || Title font size | 110–140px | 90–112px || Decoration | One large, subtle tilted shape in a corner | One circular halo behind the object || Starter file | `assets/title-hero.html` | `assets/object-hero.html` | Core principles:- Keep total elements to 4 or fewer: eyebrow (a short category label), title, object or accent decoration, and brand mark. Never include summaries, dates, author names, or hashtags (they all turn into smudges at 320px).- Limit the palette to 1 background + 1 text + 1 accent color. Apply the accent color only to the single most important word in the title (the number, if one is present).- Maintain strong luminance contrast between background and title (white text on a dark background, charcoal text on a light background). Never place text over photographs or busy patterns. ## 2. Two-Line Korean Title Block Never drop the full article title in verbatim. **Condense it for thumbnail display and split it into two lines.** 1. Keep only the core words, trimming the total to 8–16 characters (excluding spaces). Move dropped context up into the eyebrow. `"연말정산 놓치기 쉬운 공제 7가지"` ("7 Easily Missed Year-End Tax Deductions") → Eyebrow `연말정산` + Title `놓치기 쉬운 / 공제 7가지`2. Insert `<br>` manually **at a natural semantic break**. Never rely on automatic browser wrapping (`white-space: nowrap`).3. Keep each line to 4–8 characters, with a length difference of 3 characters or fewer between lines. If one line is noticeably shorter, shift a word or rephrase.4. Never start a line with a particle or verb ending, and never split numbers from their units (`"7가지"`, `"3개월"`).5. Apply the accent color to the second line or to a single key/numeric phrase.6. Use a line-height of 1.1–1.2, letter-spacing around `-0.03em`, and font-weight 800–900. Both lines should read as one cohesive visual block. | Poor Line Break | Good Line Break ||---|---|| 연말정산 놓치기 쉬운 공제 / 7가지 (unbalanced line lengths) | 놓치기 쉬운 / 공제 7가지 || 전세 계약 전에 꼭 / 확인할 것들 (weak, generic phrasing) | 전세 계약 전 / 등기부 3분 확인 || 초보자를 위한 엑셀 함 / 수 정리 (splits a word in half) | 엑셀 함수 / 이것만 12개 | Estimating font size: One Korean character is roughly as wide as its font size. `font size ≈ usable width ÷ character count of the longer line (count spaces as 0.3 chars)`. Usable width is roughly 960px for Title-Hero and 520px for Object-Hero. If the calculated value falls below the range in the table above, shorten the title—do not shrink the font size. **Fonts**: Specify `"Inter", "Noto Sans KR", "Noto Sans CJK KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif` in that order to pick up whichever font is installed. You may load a web font via `<link>` (use `--wait` during capture to let it load), though offline environments will fall back to installed fonts. If Korean text renders as empty boxes (`□`), the environment lacks Korean fonts—notify the user. ## 3. HTML Authoring Rules Copy and edit a starter file from `assets/`. Follow these rules strictly: - `html, body { width: 1200px; height: 630px; margin: 0; overflow: hidden; }` — lock dimensions to match the capture size (`600` for 1200×600).- Keep everything in a single self-contained file. Put CSS inside `<style>` and draw graphics with CSS shapes or inline SVG. If external images are used, place them in the same folder and reference them with relative paths.- Set `word-break: keep-all` on `body`.- **Keep core content within the center 80%**: horizontally 120–1080px, vertically 63–567px (60–540px for 1200×600). Messaging apps like KakaoTalk often crop link previews close to 2:1, and list views crop even tighter around the center. Place only background and decorative elements in the outer 10% border.- Add inspection attributes so the script can locate and validate elements: | Attribute | Where to apply | Purpose | |---|---|---| | `data-check="name"` | Primary visible elements (eyebrow, title, object, brand) | Checked for overlap, clipping, and margins | | `data-core` | Title, hero object | Must remain inside the center 80% safe zone | | `data-lines="2"` | Title | Verifies that the title actually renders on 2 lines | | `data-bleed` | Decorations intentionally extending past the canvas edge | Exempt from clipping and margin checks | | `data-overlap-ok` | Elements intentionally overlapping (e.g., a stamp on an object) | Exempt from overlap checks | | `data-small-ok` | Brand mark, decorative micro-text inside an object | Exempt from small-text legibility warnings | **Drawing Objects**- Tilt objects **5–15 degrees** (`transform: rotate(8deg)`). Perfectly horizontal/vertical objects look stiff and lifeless, like document diagrams. Tilting adds motion and creates contrast against the level title. Beyond 15 degrees, the object looks like it is tipping over.- Never tilt the title (preserves legibility).- Build objects as bold, simple forms: a rounded rectangle + a few clean lines + one accent color. The subject must be recognizable by silhouette alone at 320px—fine detail disappears.- Lift the object off the background with a soft shadow (`box-shadow: 0 30px 60px rgba(0,0,0,.3)`).- Placing a small counter-tilted element (stamp, badge) on top of the object adds energy. Mark overlaid elements with `data-overlap-ok`.- Rotation expands the outer bounding box (a 280×360 box rotated 8° becomes roughly 327×395). Leave generous breathing room. ## 4. Capture and Layout Inspection ```bashpython3 scripts/shot.py thumb.html -o thumb.png --check # 1200×630python3 scripts/shot.py thumb.html -o thumb.png --size 1200x600 --check``` The script uses only the Python standard library and automatically locates an installed Chrome, Chromium, or Edge binary for headless capture (if not found, pass `--chrome <path>` or set the `CHROME` environment variable). For slow-loading web fonts or images, add `--wait 6000`. Reading the output: | Output | Meaning | Action ||---|---|---|| `[capture] … 1200×630px` | PNG generated with verified dimensions | If dimensions differ, check fixed `body` sizing || Per-element `x y width×height` | Actual rendered coordinates | Use to verify spacing and gaps || `[margins] left·right·top·bottom` | Distance from combined bounding box to canvas edges | Target ≤96px left/right delta, ≤63px top/bottom delta || `[error] A ↔ B overlap` | Two elements overlap | Adjust position/size, or add `data-overlap-ok` if intentional || `[error] Core element outside center 80%` | Risks being cropped in previews | Move inward or scale down || `[error] Title rendered on N lines` | Rendered line count differs from target | Adjust font size or manual `<br>` breaks || `[error] Out of canvas bounds` | Element is clipped | Reposition, or add `data-bleed` if intentional decoration || `[warning] Font size Npx at 320px` | Text will be unreadable when scaled down | Enlarge or remove || `[warning] Off-center` / `margin Npx` | Visual balance may be off | Evaluate visually in step 5 | Any `[error]` exits with code 1. Iterate until errors reach 0. Evaluate warnings visually (in an Object-Hero layout, slight left/right margin asymmetry is acceptable because text and objects carry different visual weight). ## 5. Visually Inspect the Proof Sheet Running `--check` also generates `thumb_check.png`. **Open and inspect this image directly.** Automated checks only measure coordinates—color contrast, visual cohesion, and whether an object reads clearly can only be judged by eye. 1. **320px scaled preview**: Are both title lines instantly legible? Does the accent word pop first? Is the object recognizable from its silhouette alone?2. **2:1 messenger preview**: Do the title and object stay intact when the top and bottom edges are cropped?3. **Center 80% guide lines**: Are the title and hero object completely inside the red dashed frame?4. **Full-size original**: Is all Korean text rendering properly without missing-glyph boxes? Are letter strokes clear of decorations and objects? Does any side feel awkwardly empty? Is the object tilted 5–15 degrees? If anything is off, edit the HTML and repeat from step 4. Plan for 2–3 iterations. ## 6. Delivery Provide the user with:- PNG file path, dimensions, and file size (if over 300KB, tone down shadows and gradients)- Editable HTML file path- One-line inspection summary (0 errors, plus any remaining warnings and why they were kept)- Ready-to-paste HTML meta tags: ```html<meta property="og:image" content="https://example.com/path/thumb.png"><meta property="og:image:width" content="1200"><meta property="og:image:height" content="630"><meta name="twitter:card" content="summary_large_image">``` When producing a batch (e.g., an entire post list), use one HTML file as a template, swap only the title, eyebrow, and accent color for each file, and run `--check` on every single image. Different title lengths change line wrapping and overlap—never inspect just one and assume the rest pass. ## Pre-Delivery Checklist - [ ] Layout is strictly either Title-Hero or Object-Hero, with 4 or fewer elements- [ ] Title is split at a natural semantic break into two lines with ≤3 characters difference in length- [ ] `--check` reports 0 errors and PNG dimensions match the request- [ ] Proof sheet opened and title confirmed legible in the 320px preview- [ ] Title and hero object sit inside the center 80% safe zone- [ ] Object is tilted 5–15 degrees and title is level- [ ] Korean text renders cleanly with no broken glyphs- [ ] No real company logos, trademarks, or photos of real people were inserted without permission- [ ] PNG path, HTML path, and meta tags delivered to the user<!doctype html><html lang="ko"><head><meta charset="utf-8"><title>사물 주인공형 1200×630</title><style> :root { --w: 1200px; --h: 630px; --bg: #14213D; --ink: #FFFFFF; --accent: #FFD43B; } * { box-sizing: border-box; margin: 0; padding: 0; } html, body { width: var(--w); height: var(--h); overflow: hidden; } body { background: var(--bg); color: var(--ink); position: relative; font-family: "Inter", "Noto Sans KR", "Noto Sans CJK KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; word-break: keep-all; } /* 왼쪽 글 영역: 가로 120~640 */ .copy { position: absolute; left: 120px; top: 63px; bottom: 63px; width: 520px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 26px; } .kicker { font-size: 28px; font-weight: 700; padding: 8px 18px; border-radius: 999px; background: rgba(255,255,255,.12); color: var(--accent); } .title { font-size: 100px; font-weight: 900; line-height: 1.14; letter-spacing: -0.035em; white-space: nowrap; } .title em { font-style: normal; color: var(--accent); } /* 오른쪽 사물 영역: 가로 680~1080. 사물은 5~15도 기울인다 */ .object-wrap { position: absolute; left: 680px; top: 63px; width: 400px; height: 504px; display: flex; align-items: center; justify-content: center; } .object { width: 280px; height: 360px; border-radius: 20px; background: #fff; transform: rotate(8deg); box-shadow: 0 30px 60px rgba(0,0,0,.35); } .halo { position: absolute; left: 700px; top: 135px; width: 360px; height: 360px; border-radius: 50%; background: var(--accent); opacity: .16; }</style></head><body> <div class="halo"></div> <div class="copy"> <div class="kicker" data-check="머리말" data-core>머리말</div> <h1 class="title" data-check="제목" data-core data-lines="2">첫 줄 덩어리<br><em>둘째 줄</em></h1> </div> <div class="object-wrap"> <!-- 사물: CSS 도형·인라인 SVG·이미지 중 하나. 회전된 실제 외곽으로 검사된다 --> <div class="object" data-check="사물" data-core></div> </div></body></html><!doctype html><html lang="ko"><head><meta charset="utf-8"><title>제목 주인공형 1200×630</title><style> /* 캔버스: 찍는 크기와 반드시 같게. 1200×600으로 찍을 때는 --h 만 600으로 */ :root { --w: 1200px; --h: 630px; --bg: #F4F1EA; --ink: #16181D; --accent: #E8590C; } * { box-sizing: border-box; margin: 0; padding: 0; } html, body { width: var(--w); height: var(--h); overflow: hidden; } body { background: var(--bg); color: var(--ink); position: relative; font-family: "Inter", "Noto Sans KR", "Noto Sans CJK KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; word-break: keep-all; /* 한글이 낱말 중간에서 끊기지 않게 */ } /* 중앙 80% 안(가로 120~1080, 세로 63~567)에 제목 덩어리를 가로·세로 가운데로 */ .stage { position: absolute; left: 120px; right: 120px; top: 63px; bottom: 63px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 28px; } .kicker { font-size: 30px; font-weight: 700; letter-spacing: -0.01em; color: var(--accent); } .title { font-size: 128px; font-weight: 900; line-height: 1.12; letter-spacing: -0.035em; white-space: nowrap; } .title em { font-style: normal; color: var(--accent); } .brand { font-size: 26px; font-weight: 700; opacity: .55; } /* 장식: 제목 뒤에 깔리는 도형. 기울여서 정적인 화면을 깬다 */ .deco { position: absolute; right: -60px; top: -80px; width: 380px; height: 380px; border-radius: 48px; background: var(--accent); opacity: .12; transform: rotate(12deg); }</style></head><body> <div class="deco"></div> <div class="stage"> <div class="kicker" data-check="머리말" data-core>머리말 한 줄</div> <!-- 두 줄 덩어리: 뜻 단위로 직접 <br>. data-lines 는 의도한 줄 수 --> <h1 class="title" data-check="제목" data-core data-lines="2">첫 줄 여섯 자<br><em>둘째 줄</em> 덩어리</h1> <div class="brand" data-check="브랜드" data-small-ok>brand.example</div> </div></body></html>#!/usr/bin/env python3"""HTML 한 장을 크롬 헤드리스로 찍어 썸네일·OG 이미지(PNG)를 만든다. 파이썬 표준 라이브러리만 쓴다. 사용법 python3 shot.py thumb.html # thumb.png (1200x630) python3 shot.py thumb.html --size 1200x600 # 2:1 python3 shot.py thumb.html -o og.png --check # 찍기 + 배치 검사 + 축소 확인판(og_check.png) --check 가 하는 일 1) 배치 검사: data-check 속성이 붙은 요소의 실제 좌표를 읽어 겹침, 캔버스 밖 삐져나감, 가장자리 여백, 중앙 80% 이탈(data-core), 제목 줄 수(data-lines), 320px 축소 시 글자 크기를 검사한다. 2) 확인판: 원본 축소본 + 320px 축소본 + 2:1 가운데 자르기(중앙 80% 안내선)를 한 장에 모아 찍는다. 이 이미지를 직접 열어 눈으로 확인한다. 종료 코드: 0 = 통과(경고만 있어도 0), 1 = 오류(찍기 실패·크기 불일치·배치 오류)크롬 경로를 못 찾으면 --chrome 또는 환경 변수 CHROME 으로 지정한다."""import argparseimport jsonimport osimport reimport shutilimport structimport subprocessimport sysimport tempfileimport urllib.parsefrom pathlib import Path CANDIDATES = [ "google-chrome", "google-chrome-stable", "chromium", "chromium-browser", "chrome", "microsoft-edge", "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome", "/Applications/Chromium.app/Contents/MacOS/Chromium", "/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge", r"C:\Program Files\Google\Chrome\Application\chrome.exe", r"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe", r"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe",] LINT_JS = r"""<script>(function () { function run() { var W = __W__, H = __H__, out = {items: [], errors: [], warnings: []}; var body = document.body.getBoundingClientRect(); if (Math.round(body.width) !== W || Math.round(body.height) !== H) out.errors.push('body 크기가 ' + Math.round(body.width) + '×' + Math.round(body.height) + ' — 캔버스 ' + W + '×' + H + '와 같게 고정할 것'); var els = Array.prototype.slice.call(document.querySelectorAll('[data-check]')); if (!els.length) out.warnings.push('data-check 속성이 붙은 요소가 없어 배치 검사를 건너뜀'); var boxes = els.map(function (el) { var r = el.getBoundingClientRect(), cs = getComputedStyle(el); var b = {name: el.getAttribute('data-check') || el.tagName.toLowerCase(), l: r.left, t: r.top, r: r.right, b: r.bottom, w: r.width, h: r.height, font: null, el: el}; var tw = document.createTreeWalker(el, NodeFilter.SHOW_TEXT), n; // 안에 든 글자 중 가장 작은 크기 while ((n = tw.nextNode())) { if (!n.nodeValue.trim()) continue; var f = parseFloat(getComputedStyle(n.parentElement).fontSize); if (b.font === null || f < b.font) b.font = f; } out.items.push({name: b.name, x: Math.round(b.l), y: Math.round(b.t), w: Math.round(b.w), h: Math.round(b.h)}); return b; }); boxes.forEach(function (b) { var el = b.el; if (!el.hasAttribute('data-bleed') && (b.l < -0.5 || b.t < -0.5 || b.r > W + 0.5 || b.b > H + 0.5)) out.errors.push(b.name + ': 캔버스 밖으로 나감 (' + Math.round(b.l) + ',' + Math.round(b.t) + ' ~ ' + Math.round(b.r) + ',' + Math.round(b.b) + ')'); if (el.hasAttribute('data-core') && (b.l < W * 0.1 - 0.5 || b.r > W * 0.9 + 0.5 || b.t < H * 0.1 - 0.5 || b.b > H * 0.9 + 0.5)) out.errors.push(b.name + ': 핵심 요소가 중앙 80% 밖 (가로 ' + Math.round(W * 0.1) + '~' + Math.round(W * 0.9) + ', 세로 ' + Math.round(H * 0.1) + '~' + Math.round(H * 0.9) + ' 안에 둘 것)'); if (el.scrollWidth > el.clientWidth + 1 && getComputedStyle(el).overflow !== 'visible') out.errors.push(b.name + ': 글자가 상자 폭을 넘쳐 잘림'); if (el.hasAttribute('data-lines')) { var want = parseInt(el.getAttribute('data-lines'), 10), tops = {}, range = document.createRange(); range.selectNodeContents(el); Array.prototype.forEach.call(range.getClientRects(), function (rc) { if (rc.width > 1) tops[Math.round(rc.top / 4)] = 1; }); var got = Object.keys(tops).length; if (got !== want) out.errors.push(b.name + ': 제목이 ' + got + '줄로 그려짐 (의도 ' + want + '줄). 글자 크기를 줄이거나 줄바꿈 위치를 고칠 것'); } if (b.font !== null && !el.hasAttribute('data-small-ok')) { var at320 = b.font * 320 / W; if (at320 < 7) out.warnings.push(b.name + ': 320px 축소 시 가장 작은 글자 ' + at320.toFixed(1) + 'px — 읽히지 않음. 빼거나 ' + Math.ceil(7 * W / 320) + 'px 이상으로(장식 글자면 data-small-ok)'); } }); for (var i = 0; i < boxes.length; i++) for (var j = i + 1; j < boxes.length; j++) { var a = boxes[i], c = boxes[j]; if (a.el.contains(c.el) || c.el.contains(a.el)) continue; if (a.el.hasAttribute('data-overlap-ok') || c.el.hasAttribute('data-overlap-ok')) continue; var ox = Math.min(a.r, c.r) - Math.max(a.l, c.l), oy = Math.min(a.b, c.b) - Math.max(a.t, c.t); if (ox > 1 && oy > 1) out.errors.push(a.name + ' ↔ ' + c.name + ': ' + Math.round(ox) + '×' + Math.round(oy) + 'px 겹침'); else if (ox > 1 && oy > -12 || oy > 1 && ox > -12) out.warnings.push(a.name + ' ↔ ' + c.name + ': 간격 12px 미만으로 붙어 있음'); } var inner = boxes.filter(function (b) { return !b.el.hasAttribute('data-bleed'); }); if (inner.length) { var L = Math.min.apply(null, inner.map(function (b) { return b.l; })), T = Math.min.apply(null, inner.map(function (b) { return b.t; })); var R = W - Math.max.apply(null, inner.map(function (b) { return b.r; })), B = H - Math.max.apply(null, inner.map(function (b) { return b.b; })); out.margins = {left: Math.round(L), right: Math.round(R), top: Math.round(T), bottom: Math.round(B)}; var minM = Math.min(L, R, T, B); if (minM < H * 0.06) out.warnings.push('가장자리 여백 ' + Math.round(minM) + 'px — ' + Math.round(H * 0.06) + 'px 이상 권장'); if (Math.abs(L - R) > W * 0.08) out.warnings.push('좌우 여백 차이 ' + Math.round(Math.abs(L - R)) + 'px (왼쪽 ' + Math.round(L) + ', 오른쪽 ' + Math.round(R) + ') — 한쪽으로 쏠림'); if (Math.abs(T - B) > H * 0.10) out.warnings.push('상하 여백 차이 ' + Math.round(Math.abs(T - B)) + 'px (위 ' + Math.round(T) + ', 아래 ' + Math.round(B) + ') — 한쪽으로 쏠림'); } document.documentElement.setAttribute('data-thumb-lint', encodeURIComponent(JSON.stringify(out))); } function go() { (document.fonts && document.fonts.ready ? document.fonts.ready : Promise.resolve()).then(run, run); } if (document.readyState === 'complete') go(); else window.addEventListener('load', go);})();</script>""" SHEET = """<!doctype html><html><head><meta charset="utf-8"><style>*{{box-sizing:border-box}} body{{margin:0;width:1000px;background:#e9ebee;font:14px/1.4 system-ui,sans-serif;color:#333;padding:24px}}h3{{margin:0 0 8px;font-size:14px;font-weight:600}} .row{{display:flex;gap:24px;align-items:flex-start;margin-bottom:22px}}img{{display:block}} .crop{{position:relative;width:560px;height:280px;overflow:hidden}}.crop img{{width:560px;height:280px;object-fit:cover;object-position:center}}.guide{{position:absolute;left:10%;top:10%;width:80%;height:80%;border:2px dashed #ff2d55;box-sizing:border-box}}.chat{{background:#b2c7d9;padding:16px;width:352px}} .card{{background:#fff;border-radius:10px;overflow:hidden;width:320px}}.card img{{width:320px;height:160px;object-fit:cover}} .meta{{padding:9px 12px;font-size:13px;color:#222}} .meta small{{color:#999;display:block}}</style></head><body><div class="row"><div><h3>원본 {w}×{h} (절반 크기)</h3><img src="{src}" width="{hw}"></div></div><div class="row"> <div><h3>320px 축소: 제목이 한눈에 읽혀야 한다</h3><img src="{src}" width="320"></div> <div><h3>메신저 미리보기 2:1 (가운데 자르기, 폭 320px)</h3><div class="chat"><div class="card"><img src="{src}"><div class="meta">링크 제목 자리<small>example.com</small></div></div></div></div></div><div class="row"><div><h3>2:1 가운데 자르기 + 중앙 80% 안내선(빨간 점선): 제목·주인공 사물이 안에 있어야 한다</h3> <div class="crop"><img src="{src}"><div class="guide"></div></div></div></div></body></html>""" def find_chrome(explicit): for cand in [explicit, os.environ.get("CHROME")] + CANDIDATES: if not cand: continue if os.path.isfile(cand): return cand found = shutil.which(cand) if found: return found sys.exit("크롬(또는 크로미움·엣지)을 찾지 못했습니다. --chrome 경로 또는 환경 변수 CHROME 을 지정하세요.") def run_chrome(chrome, args, wait_ms, timeout=90): profile = tempfile.mkdtemp(prefix="thumb-shot-") cmd = [chrome, "--headless=new", "--disable-gpu", "--hide-scrollbars", "--force-device-scale-factor=1", "--no-first-run", "--no-default-browser-check", "--disable-extensions", "--allow-file-access-from-files", f"--user-data-dir={profile}", f"--virtual-time-budget={wait_ms}"] if hasattr(os, "geteuid") and os.geteuid() == 0 or os.environ.get("THUMB_NO_SANDBOX"): cmd.append("--no-sandbox") try: return subprocess.run(cmd + args, capture_output=True, text=True, timeout=timeout, errors="replace") except subprocess.TimeoutExpired: sys.exit(f"크롬이 {timeout}초 안에 끝나지 않았습니다.") finally: shutil.rmtree(profile, ignore_errors=True) def png_size(path): with open(path, "rb") as f: head = f.read(24) if len(head) < 24 or head[:8] != b"\x89PNG\r\n\x1a\n": return None return struct.unpack(">II", head[16:24]) def screenshot(chrome, html, out, w, h, wait_ms): if out.exists(): out.unlink() res = run_chrome(chrome, [f"--window-size={w},{h}", f"--screenshot={out}", html.resolve().as_uri()], wait_ms) if not out.exists(): sys.exit("찍기 실패: PNG가 만들어지지 않았습니다.\n" + (res.stderr or "")[-800:]) return png_size(out) def lint(chrome, html, w, h, wait_ms): src = html.read_text(encoding="utf-8") tmp = html.with_name(f".{html.stem}.lint.html") # 상대 경로 자원이 그대로 읽히도록 같은 폴더에 둔다 low = src.lower() pos = low.rfind("</body>") js = LINT_JS.replace("__W__", str(w)).replace("__H__", str(h)) tmp.write_text(src[:pos] + js + src[pos:] if pos >= 0 else src + js, encoding="utf-8") try: # --dump-dom 은 창 높이에서 테두리만큼 뷰포트가 줄어든다. 좌표는 body 고정 크기 기준이라 높이에 여유만 둔다 res = run_chrome(chrome, [f"--window-size={w},{h + 300}", "--dump-dom", tmp.resolve().as_uri()], wait_ms) finally: tmp.unlink(missing_ok=True) m = re.search(r'data-thumb-lint="([^"]+)"', res.stdout or "") if not m: return None return json.loads(urllib.parse.unquote(m.group(1))) def main(): ap = argparse.ArgumentParser(description="HTML 한 장을 크롬 헤드리스로 찍어 PNG 썸네일을 만든다.") ap.add_argument("html", help="찍을 HTML 파일") ap.add_argument("-o", "--out", help="출력 PNG 경로 (기본: HTML과 같은 이름 .png)") ap.add_argument("--size", default="1200x630", help="가로x세로 (기본 1200x630, 2:1은 1200x600)") ap.add_argument("--check", action="store_true", help="배치 검사와 축소 확인판(_check.png) 생성") ap.add_argument("--wait", type=int, default=3000, help="글꼴·이미지 로딩 대기(ms, 기본 3000)") ap.add_argument("--chrome", help="크롬 실행 파일 경로") a = ap.parse_args() html = Path(a.html) if not html.is_file(): sys.exit(f"파일이 없습니다: {html}") m = re.fullmatch(r"(\d+)[xX×](\d+)", a.size) if not m: sys.exit("--size 는 1200x630 형식으로 적습니다.") w, h = int(m.group(1)), int(m.group(2)) out = Path(a.out) if a.out else html.with_suffix(".png") chrome = find_chrome(a.chrome) failed = False size = screenshot(chrome, html, out, w, h, a.wait) print(f"[찍기] {out} {size[0]}×{size[1]}px {out.stat().st_size // 1024}KB") if size != (w, h): print(f"[오류] 이미지 크기가 {w}×{h}가 아닙니다. html·body에 margin:0, width:{w}px, height:{h}px, overflow:hidden 을 확인하세요.") failed = True if a.check: rep = lint(chrome, html, w, h, a.wait) if rep is None: print("[오류] 배치 검사 결과를 읽지 못했습니다(HTML에 </body>가 있는지 확인).") failed = True else: for it in rep["items"]: print(f" - {it['name']}: x={it['x']} y={it['y']} {it['w']}×{it['h']}") if rep.get("margins"): mg = rep["margins"] print(f"[여백] 왼쪽 {mg['left']} · 오른쪽 {mg['right']} · 위 {mg['top']} · 아래 {mg['bottom']} (px)") for e in rep["errors"]: print("[오류]", e) for wmsg in rep["warnings"]: print("[경고]", wmsg) if rep["errors"]: failed = True if not rep["errors"] and not rep["warnings"]: print("[배치] 겹침·이탈·쏠림 없음") sheet_png = out.with_name(out.stem + "_check.png") sheet_html = out.with_name(f".{out.stem}.sheet.html") sheet_html.write_text(SHEET.format(src=urllib.parse.quote(out.name), w=w, h=h, hw=w // 2), encoding="utf-8") try: sheet_h = 24 + 30 + h // 2 + 22 + 30 + 260 + 22 + 30 + 280 + 24 screenshot(chrome, sheet_html, sheet_png, 1000, sheet_h, 1500) finally: sheet_html.unlink(missing_ok=True) print(f"[확인판] {sheet_png} ← 이 이미지를 열어 320px 가독성과 2:1 잘림을 눈으로 확인") sys.exit(1 if failed else 0) if __name__ == "__main__": main()Sample Skill Output
Output
| File | Description |
|---|---|
output.png |
OG image, 1200×630px, 64KB |
thumb.html |
Editable source (single HTML/CSS file, no external files) |
output_check.png |
Proof sheet: scaled original · 320px thumbnail · 2:1 messenger preview · center 80% guides |
Design
- Dimensions: 1200×630 (standard OG size for KakaoTalk and social sharing). Key elements are placed within the center 80% so they remain intact even when cropped to 2:1.
- Composition: Hero-object layout. Chosen because there is an object (a receipt) that communicates "deductions" at a glance. Text on the left + receipt on the right.
- Two-line title block: Original title "연말정산 놓치기 쉬운 공제 7가지" (7 Easy-to-Miss Year-End Tax Deductions, 15 characters excluding spaces)
→ Eyebrow
연말정산(Year-End Tax) + Title놓치기 쉬운/공제 7가지(5 chars / 5 chars, keeping the number and unit together) - Typography: Title 108px · weight 900 · line-height 1.14 · letter-spacing -0.035em. Scales down to roughly 29px at 320px width.
- Colors: Navy background
#14213D+ white text + yellow accent#FFD43B(used only on the second line and the stamp) - Object: CSS-drawn receipt tilted 8 degrees. Only the 3 missed line items are marked in red. Overlaid with a "7가지" (7 items) stamp angled in the opposite direction (-14 degrees).
- Element count: Eyebrow, title, brand (
살림숫자), receipt — 4 elements.
Capture & Layout Check (python3 scripts/shot.py thumb.html -o output.png --check)
[capture] output.png 1200×630px 64KB
- eyebrow: x=120 y=124 144×52
- title: x=120 y=202 469×246
- brand: x=120 y=475 90×31
- receipt: x=730 y=112 319×406
- stamp: x=907 y=342 145×145
[margins] left 120 · right 147 · top 112 · bottom 112 (px)
[layout] no overlap · no overflow · no imbalance
[proof] output_check.png
- 0 errors, 0 warnings.
- 141px gap between the right edge of the title (589px) and the left edge of the receipt (730px).
- Both the title (120–589, 202–448) and the receipt (730–1049, 112–518) fit inside the center 80% safe area (horizontal 120–1080, vertical 63–567).
Revisions (Draft 1 → Final)
| Issue Caught in Draft 1 | Fix |
|---|---|
| The serrated edge at the bottom of the receipt rendered as heart-shaped dots instead of the intended jagged edge (spotted on the proof sheet) | Removed the serrated edge and simplified it into a rounded-corner card |
| The yellow glow behind the object blended with the navy background and looked muddy (spotted on the proof sheet) | Replaced with a 7% white glow |
| Warning that text inside the receipt and stamp falls below 6px at 320px width | Added data-small-ok since it is part of the object rather than text meant to be read |
Visual Check on the Proof Sheet
- 320px thumbnail: Both lines of "놓치기 쉬운 / 공제 7가지" are legible, with the yellow second line catching the eye first. The receipt is clearly recognizable from its silhouette and red highlights.
- 2:1 messenger preview: Even with top and bottom cropping, the eyebrow, title, brand, and receipt all remain intact.
- No broken Korean characters; no text touches the object.
Tags to Add to the Page
<meta property="og:image" content="https://example.com/images/year-end-tax-7.png">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta name="twitter:card" content="summary_large_image">
Replace the content URL with the actual uploaded image path.
I'm publishing a blog post titled "7 Easy-to-Miss Year-End Tax Deductions." Please create a featured image (OG image) to display when sharing it on KakaoTalk and social media. I don't have any photo assets. The blog name is "Household Numbers" (a fictional blog).
How to use the skill instructions in Claude, Gemini, Codex or ChatGPT
Prepare your source material
Unzip the package and read SKILL.md and its references. Describe the task, whose work it is for, the source material and the expected deliverable.
Draft with AI
In a Claude or Codex setup with Agent Skills support, follow its skill-loading procedure. In Gemini or ChatGPT, provide SKILL.md and the relevant references as task instructions.
Review the finished file
Run one case similar to the demonstration to check the result. If the package includes scripts, check their runtime and external requirements first.
Frequently asked questions
How can I phrase a request to the skill?
Make a blog thumbnail · Create an OG image · Make an image that appears when sharing a link on KakaoTalk · Design a featured image for this post · Create a 1200x630 link preview image
Which files are included in the ZIP?
SKILL.md · assets/object-hero.html · assets/title-hero.html · scripts/shot.py
What deliverable should I expect?
PNG image (1200×630 or 1200×600), editable HTML file, scaled review sheet PNG, and og:image meta tag
What should I verify before using the result at work?
Inspect the title at thumbnail size. Verify the exported PNG dimensions and the actual og:image URL.
12 Claude Skills
slop-free-deck/ ├─ SKILL.md ├─ references/ │ ├─ layout-catalog.md │ └─ palette-derivation.md └─ scripts/ └─ deck_check.pySlop-Free Deck Design Rules Strip AI clichés and repetitive layouts out of Claude-generated slide decks “Make a PPT for me” slop-free-deck.zip21KB
korean-report-style/ ├─ SKILL.md └─ references/ ├─ rewrite-list.md └─ structures.mdKorean Corporate Report Style Enforce conclusion-first structure, concise bullet endings, and strict number formatting “Turn this draft into a review report” korean-report-style.zip18KB
meeting-minutes-kr/ ├─ SKILL.md └─ references/ └─ formats.mdMeeting Minutes & Follow-Up Email Generate structured agenda minutes and an attendee follow-up email in one pass “Turn this transcript into meeting minutes” meeting-minutes-kr.zip10KB
weekly-report-kr/ ├─ SKILL.md └─ references/ └─ sentence-examples.mdWeekly Report Continuity & Impact Connect last week's plans to this week's outcomes with consistent status labels “Write this week's weekly report” weekly-report-kr.zip12KB
proposal-writer-kr/ ├─ SKILL.md └─ references/ └─ chapter-guide.mdB2B Proposal Logic & Writer Reframe client pain points and pair every section claim with quantitative proof “Write a proposal” proposal-writer-kr.zip8KB
public-bid-proposal/ ├─ SKILL.md └─ references/ └─ requirement-extraction.mdPublic Bid & RFP Compliance Writer Extract every RFP requirement ID and draft sections mapped to scoring rubrics “Analyze this RFP” public-bid-proposal.zip8KB
data-story-chart/ ├─ SKILL.md └─ references/ └─ recipes.mdData Story & Chart Selector Pinpoint the core numerical takeaway and match it to an undistorted chart type “Make a chart from this data” data-story-chart.zip8KB
seo-article-kr/ ├─ SKILL.md └─ references/ └─ ai-style-fixes.mdKorean SEO Article Writer Draft natural, search-intent-driven Korean articles free of awkward translationese “Write a blog post for this keyword” seo-article-kr.zip11KB
brand-voice-keeper/ ├─ SKILL.md ├─ references/ │ └─ voice-card-template.md └─ scripts/ └─ voice_stats.pyBrand Voice Extractor & Keeper Extract tone, sentence rhythm, and vocabulary rules from existing copy for new drafts “Write this in our voice” brand-voice-keeper.zip10KB
excel-analyst-kr/ ├─ SKILL.md ├─ references/ │ └─ number-style.md └─ scripts/ └─ profile_csv.pyExcel & CSV Data Analyst Audit raw tables for missing values and outliers, then report actionable insights “Analyze this Excel file and turn it into a report” excel-analyst-kr.zip14KB
email-reply-kr/ ├─ SKILL.md └─ references/ └─ phrases.mdBusiness Email Reply Writer Break down incoming emails and draft tailored accept, negotiate, or decline replies “Draft a reply to this email” email-reply-kr.zip12KB