본문으로 건너뛰기
Skillpedia
인터페이스 (UI/UX)40k · #7460

ui-screenshots

하는 일

이 도구는 개발 중인 웹사이트나 앱의 '사진'을 찍습니다. 화면이 시각적으로 어떻게 바뀌는지 보는 데 도움을 줍니다.

사용하는 경우

  • ✓변경하기 전에 웹사이트가 어떻게 보이는지 기록하고 싶을 때.
  • ✓마우스를 올렸을 때 나타나는 메뉴 같은 특정 상태를 보여 주고 싶을 때.
  • ✓전체 화면을 다시 찍지 않고 화면의 일부만 캡처하고 싶을 때.

스킬 링크

https://github.com/github/awesome-copilot/blob/main/skills/ui-screenshots/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/github/awesome-copilot/blob/main/skills/ui-screenshots/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“http://mysite.com의 웹사이트 스크린샷을 찍어 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

도구는 Playwright라는 프로그램으로 웹사이트를 '보고' 전체 화면을 찍습니다. 그다음 PIL이라는 다른 도구로 사진을 잘라 원하는 부분만 보여 줍니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

UI Screenshots

Capture screenshots of web apps and graphical UIs during development to document visual changes.

When to Use This Skill

Use this skill when you need to:

  • Capture the current state of a running web app
  • Document a UI before and after a code change
  • Screenshot interactive states (tooltips, hovers, selected elements)
  • Capture specific sections of a page without re-screenshotting

Prerequisites

pip install playwright Pillow -q
playwright install chromium

Core Workflow

1. Take a raw full-page screenshot

from playwright.async_api import async_playwright

async def capture(url="http://localhost:3000", out="screenshot-raw.png", width=1400, height=5000):
    async with async_playwright() as p:
        browser = await p.chromium.launch()
        page = await browser.new_page(viewport={"width": width, "height": height})
        await page.goto(url, wait_until="networkidle")
        await page.wait_for_timeout(4000)  # let charts/animations render
        await page.screenshot(path=out, full_page=True)
        await browser.close()
  • Use a tall viewport (height=5000) so the page renders everything without scrolling
  • wait_until="networkidle" + wait_for_timeout(4000) ensures async charts load
  • full_page=True captures the entire scrollable content

2. View the raw image, then crop with PIL

Do NOT try to get perfect crops via Playwright's clip parameter. It's unreliable with full-page captures.

from PIL import Image

img = Image.open("screenshot-raw.png")
cropped = img.crop((left, top, right, bottom))  # adjust based on what you see
cropped.save("screenshot-final.png")
  1. Take the raw screenshot
  2. View it to see actual pixel positions
  3. Crop with PIL based on what you see
  4. View the result — if not right, re-crop (instant, no re-screenshot needed)

3. Iterate on crop, not on capture

  • Re-screenshotting is slow (browser launch + page load + render wait)
  • Re-cropping is instant (just PIL)
  • Get one good raw capture, then slice it as many ways as needed

4. Interactive states

element = page.locator("selector").first
await element.hover()
await page.wait_for_timeout(1000)  # let tooltip appear
await page.screenshot(path="screenshot-hover.png", full_page=True)

For "selected" state without hover effect, move the mouse away after clicking:

await element.click()
await page.mouse.move(300, 300)  # move away so hover doesn't show
await page.wait_for_timeout(500)
await page.screenshot(path="screenshot-selected.png", full_page=True)

5. Section-specific captures

Crop different sections from a single full-page screenshot:

img.crop((0, 200, 920, 900)).save("screenshot-header.png")
img.crop((0, 900, 920, 1600)).save("screenshot-main.png")

Guidelines

  1. Always capture before state BEFORE making any changes — if you forget, you have to revert code to get a before shot
  2. Before/after pairs must use the same viewport width and crop — otherwise the comparison is useless
  3. To get a "before" after you already changed code: use git checkout HEAD~1 -- <files> to revert, screenshot, then git checkout HEAD -- <files> to restore
  4. For interactive states: capture before AND after for each state — don't assume the "normal" before covers all cases
  5. Use device_scale_factor=1 in Playwright to force 1x pixels so screenshots match what users see at 100% zoom
  6. Charts need extra wait time — Plotly, D3, etc. render asynchronously; 4s minimum after networkidle
  7. Narrow viewport reveals rendering bugs — some border/alignment issues only appear at specific widths

Non-Web App Screenshots

For desktop apps (VS, WPF, WinForms, console apps, terminals) where Playwright can't reach.

mss + ctypes (recommended for desktop windows)

Find a window by title via Win32 API, capture its region with mss. Tested at ~33ms per capture.

import ctypes
from ctypes import c_int, Structure, byref, windll
import mss
from PIL import Image

user32 = windll.user32

def find_window(title_contains):
    """Find visible windows matching a title substring."""
    results = []
    WNDENUMPROC = ctypes.WINFUNCTYPE(ctypes.c_bool, ctypes.c_void_p, ctypes.c_void_p)
    def cb(hwnd, _):
        if user32.IsWindowVisible(hwnd):
            buf = ctypes.create_unicode_buffer(256)
            user32.GetWindowTextW(hwnd, buf, 256)

…
자주 묻는 질문

설치해야 할 것이 있나요?

네, 'playwright'와 'Pillow' 도구를 설치한 다음, Chromium 브라우저용 Playwright 구성 요소를 내려받아야 합니다.

Playwright에서 바로 자르면 안 되나요?

Playwright에서 직접 자르면 특히 전체 페이지에서 부정확할 수 있습니다. 전체 스크린샷을 찍은 다음 PIL 도구로 정확하게 자르는 것이 더 쉽습니다.

VS Code 같은 웹이 아닌 앱의 스크린샷을 찍고 싶다면 어떻게 하나요?

데스크톱 앱에는 'mss'와 'ctypes' 라이브러리를 사용하는 다른 방법이 있습니다. 창을 찾아 사진을 찍을 수 있으며, 화면에 보이기만 하면 됩니다.

상세 정보

작성자의 원본 설명

Capture screenshots of web apps during development using Playwright and PIL. Supports full-page captures, interactive states, and an iterate-on-crop workflow that avoids slow re-screenshots.

repo: github/awesome-copilot

인기도

GitHub 스타
40k
순위
#7460
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬