What does Gallery product cards do?
Compose real product screenshots into restrained, visually pleasing high-resolution display cards. The canvas includes a built-in code-only photography studio lighting and atmosphere themes (warm-paper, dark-studio, cool-gallery, wallpaper-stage, blueprint-grid — five themes, inline SVG matte grain, zero AI-generated images). The product’s accent color is used sparingly, injected only into obscured sculptural numbering, dashed luminous guide lines, minimalist transition arrows, and focus frames. Adaptable for websites, dark-mode desktop workstations, native tools, and mobile apps.
Below, <python> refers to a Python 3.10+ interpreter: on macOS and Linux it is typically python3, on Windows typically py -3.
Step 1: Quietly check the environment
First, run a read-only check to confirm the Python version, the local browser, and availability of built-in fonts:
<python> scripts/render_cards.py doctor
If no browser is detected, stop and instruct the user to install Chrome/Chromium/Edge, or specify the executable path via the environment variable CHROME_PATH.
Step 2: Collect real product assets
Display cards must use real product screenshots, real page crops, or transparent foreground layers. Fake mock interfaces, decorative stickers, or empty marketing badges are prohibited.
- No empty filler demos: Each card must carry high-information-density real product visuals or immediately visible value comparisons. Do not use a "70% blank background + a few lines of simple code" or a plain screenshot with only a light/dark skin swap as a demo.
- True magnification principle: Link-out magnifiers (
window-callout) and before-after comparisons (before-after) must use a 2×–4× cropped zoom so that readers can clearly read interface text even in thumbnails or at 900px document width without opening the full image. Never shrink an entire window and cram it into a magnifier card or a narrow comparison panel. - If the user already has images ready, verify the file path, aspect ratio, and clarity, then use them directly.
- To capture a borderless high-definition screenshot from a local HTML file or a
localhostwebpage, use the built-in capture tool:
<python> scripts/render_cards.py capture <url-or-html> --out <png-path> --viewport 1440x900 --scale 2
To capture a specific module, add --selector "<css>"; to capture a full-page screenshot, add --full-page.
Step 3: Choose the theme, layout, and write the specification
Read the Design System & Spec Reference, determine the following four items according to the narrative goal, and write them into a UTF-8 JSON file (e.g., cards.spec.json):
Layout layout | Suitable narrative |
|---|---|
layered-hero | 2–3 layered cards + main image |
layered-bento | Left split layers + right Bento |
section-assembly | Center column sliced with dashed lines linking full page |
module-bento | 2–6 business module grid |
gallery-wall | Multi-page exhibition or tiled wall |
window-callout | Single window stage / 1-point magnifier / multi-point or blueprint annotation |
before-after | Left-right or top-bottom redesign/timeline comparison |
workflow-steps | 3–4 steps horizontal or 3D layered stage |
split-compare | Pixel-aligned split-screen comparison on a single canvas |
device-pair | Desktop + dark titanium phone same-screen display |
changelog-card | Large version number + highlights + flagship image |
- Theme
theme: Choose fromwarm-paper(warm paper texture, serif by default),dark-studio(dark anodized matte, sans-serif),cool-gallery(cool gray architectural matte, sans-serif),wallpaper-stage(code-only twilight atmosphere gradient grid + frosted glass outer frame, supportsstagePalette:twilight/ocean/sunset/emerald), orblueprint-grid(light gray#F3F5F8architectural drafting grid with crosshair registration marks). UsedisplayStyleto override the title font style individually. - Select the canvas aspect ratio (
16:9,4:3,3:4,9:16,1:1, or customWxH) and the product accent coloraccent. For dark or irregular screenshots, make good use offit,position, andbg. - Language follows conversation: All card titles, subtitles, steps, magnifier annotations, comparison labels (
before/after), and legends follow the user’s current conversation language by default (Chinese conversation → Chinese, English conversation → English). Switch only when the user explicitly requests it. - Code-only lighting and sculptural numbering: Do not use framed capsule labels. Place large
BEFORE/AFTER(automatically对比前/对比后in Chinese) and01/02/03behind the card, partially obscured by 18–25% to create depth. Cards on the same row should use either uniform full bleed or uniform white-space stage; do not mix exposed floating cards with colored wallpapers. - Default horizontal/vertical alignment for sharpness: Layouts (
split-compare,device-pair,changelog-card,before-after,window-callout,workflow-stepsrow,module-bento,section-assembly,gallery-wall) default to0degupright alignment to prevent text blur (can be explicitly set totilt: true). Onlylayered-heroandworkflow-stepsstageddefault to a slight tilt (can be set totilt: false). - Single text anchor, no scattered text: Each card retains only one text anchor in the upper-left corner: "brand logo + one short main title" (followed by a single short description line if necessary). Do not add decorative tags in the upper-right corner or scatter small text across multiple locations. Secondary caption font size should not fall below the readable threshold (
14–21px). When the title and image already tell the story clearly, omitsubtitle,caption, andfooterentirely. - If the requirement clearly exceeds the 11 built-in layouts, you may follow the reference document tokens to write custom HTML, then export it using
shoot.
Step 4: Render and auto-validate
Use the specification file to batch-generate high-resolution PNGs, standalone HTML files, and an offline preview page:
<python> scripts/render_cards.py render <spec.json> --out-dir <out-dir> --scale 2
- To fine-tune a single card, add
--only <card-id>. The script will preserve the completeindex.htmlfor other cards already in the same directory. - To export a single custom HTML card, use:
<python> scripts/render_cards.py shoot <card.html> --out <card.png> --ratio 16:9 --scale 2.
The script will automatically check image paths, font availability, image decoding, and text overflow. If errors or warnings appear, prioritize shortening copy or adjusting slot parameters before re-rendering.
Step 5: Visual spot-check and delivery
If the current host supports image viewing, check each card in <out-dir>/png/*.png: confirm sufficient title white space, clear layering, that the core screenshot content is not unintentionally cropped, and that guide lines and anchor points are clearly readable. If there are issues, adjust the spec and re-render using --only.
Upon delivery, inform the user of the PNG paths, the offline overview page path (<out-dir>/index.html), and whether there are any unresolved warnings. Do not overwrite the user’s original images without authorization.
Next steps after delivery
After the main workflow is complete and the user has not specified a follow-up action, recommend up to 3 options from the table below based on the current state:
| Candidate action | Result | Additional cost |
|---|---|---|
Switch canvas theme (warm-paper / dark-studio / cool-gallery / wallpaper-stage / blueprint-grid) | Generate another atmosphere version from the same assets and layouts for comparison | New export directory, a few seconds of re-rendering |
Adapt to vertical 3:4 / 9:16 or square 1:1 | Automatically rearrange the same assets for mobile portrait, short video cover, or square card | New files, a few seconds of re-rendering |
| Fine-tune single card composition or guide line coordinates | Use --only to locally fine-tune a single card while keeping the overview page intact | Re-render only the single card, very fast |