CommunityImagegithub.com

iithink88/cup-shop-illustration

Upload a photo of a coffee, milk tea, or any drink – automatically identify the brand, cup shape, colors, and toppings, then transform it into a 2D isometric miniature store illustration made of cups (bold black outlines, flat colors, brand title, mascot, stairs, and plants). Finally, code-stitch the original photo and illustration into a high-resolution comparison image, delivering two PNGs: the standalone illustration and the side-by-side comparison.

What is cup-shop-illustration?

This AI agent skill takes a real photo of a beverage (coffee, milk tea, soda, etc.) and transforms it into a charming, brand-themed 2D isometric store illustration, plus a high-resolution comparison image of the original photo versus the illustration. The core philosophy is to retain the identifiable features of the original drink while redesigning its architectural function – not drawing a generic cup, but turning that specific drink into a building with windows, stairs, and a little shopkeeper. The skill supports platforms like Claude Code, Cursor, and Codex via ImageGen (image-to-image) and local Python scripts. It works by first preparing the photo (fixing orientation, converting to sRGB, resizing), then visually analyzing the photo to fill out a diagnosis card (brand, drink name, cup type, colors, logo, toppings), assembling a prompt from a template, generating the illustration with ImageGen using the real photo as input, self-checking against nine criteria, removing the platform watermark, and finally code-stitching the original photo and illustration into a comparison PNG. The final output is two PNG files: the standalone illustration and the comparison image, along with the full prompt text. It enforces strict rules: must use the real photo for image generation, must preserve cup shape, main colors, logo, and features, must use 2D vector illustration style (no 3D, realism, gradients, or complex lighting), and must not crop or distort the original photo.

Works with~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/iithink88/cup-shop-illustration/tree/HEAD/cup-shop-illustration

Installed? Explore more Image skills: steipete/songsee, affaan-m/frontend-design, mattpocock/improve-codebase-architecture · View all 6 →

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

A Drink, A Tiny Store

Upload a real coffee/milk tea photo → get a delicate, brand-themed isometric store illustration, plus a high-resolution "Original vs Illustration" comparison image.

Core Principle (Just One Sentence): Preserve the identifying features of the original drink; redesign its architectural function. It's not "draw a similar cup," but "let that drink in the photo grow windows, stairs, and a little shopkeeper."

What the Final Product Looks Like

Take the GridCoffee green cup as an example: the green cup body becomes the main two-story structure, the milky white lid becomes the roof terrace, the white square logo remains on the wall as-is; arched windows and striped awnings are cut into the cup body, with a wooden staircase and greenery on the right, a mascot, small tables and chairs, and an A-frame sign out front; the entire building sits on a diagonal stone platform; the top has a rounded bold title Grid Coffee / Americano / Yunnan · Giupo Estate, on a mint green solid background with white clouds.

The style is a 2D vector illustration made in Adobe Illustrator, not a 3D scene rendered in Blender.

Workflow (Runs Automatically, No Step-by-Step Confirmation)

By default, the user uploads a drink photo, often with additional notes like brand name, drink name, coffee bean origin, or collaboration. Follow these six steps in one go.

Step 0 · Receive Image & Preprocess

PY="$HOME/.workbuddy/binaries/python/envs/default/Scripts/python.exe"
[ -x "$PY" ] || PY="$(command -v python || command -v python3)"
SK="$HOME/.workbuddy/skills/cup-shop-illustration/scripts/imgtool.py"
OUT="<current workspace>/out/cup-shop-illustration"
mkdir -p "$OUT"

"$PY" "$SK" prepare "<absolute path of user uploaded photo>" --out "$OUT/photo_clean.jpg"
  • prepare unifies EXIF orientation, converts to sRGB, removes alpha, resizes so longest edge ≤ 2048, and prints an info card (width, height, orientation, brightness, dominant colors). The orientation in the info card determines the canvas ratio and stiching direction later.
  • It only changes the file format and size, it does not alter the image content. Use photo_clean.jpg for feeding ImageGen; use the original photo uploaded by the user for stitching.
  • If the user uploads a format Pillow cannot read (e.g., HEIC / webp), convert it to PNG using system tools first, then run this step, and inform the user accordingly.

Step 1 · Observe the Photo, Fill the "Diagnosis Card"

Use visual capability to look at the original photo directly (do not use code to extract edges, do not generate a line art preemptively), and read the diagnosis card in references/diagnose.md item by item:

FieldContent
Brand NameLogo/text on the cup, prefer English name or pinyin if possible
Drink NameRead from the cup label, receipt, or user's description
Cup TypeTakeaway paper cup / transparent plastic cup / can / glass bottle, and width-to-height ratio
Top StructureFlat lid, drinking spout, straw, cream cap, whipped cream, seal
Main Color / Secondary ColorsCross-validate with dominant color info card from Step 0
Logo & TextShape, position, color (example: white hollow square + GridCoffee below cup body)
Toppings / DecorationsCoffee beans, pearls, fruit, cookie crumbs, layers, ice cubes
Origin / CollaborationYunnan estate, collaboration IP, etc., which can be turned into environmental elements

Rule: Information explicitly provided by the user takes precedence; anything unreadable from the photo must not be fabricated; instead, use descriptions like "original text/graphics on the cup body"; do not arbitrarily change the brand, colors, or cup type.

Step 2 · Assemble the Prompt

Read references/prompt-master.md, use the main template to fill in the 6 slots (brand / drink / additional instructions / canvas ratio determined by original image orientation / background color / special elements), and get a complete prompt.

  • The style clauses, negative words, and composition constraints in the template are preserved as-is, do not simplify them.
  • The final generated prompt is a core asset; include it verbatim in the delivery (users often want to reuse it).
  • When Chinese text plaques are needed, the main title should still be in English; Chinese should only be used for small decorative elements; AI Chinese is prone to garbled characters, see diagnose.md for handling.

Step 3 · Generate Image (ImageGen Image-to-Image)

⚠️ Before calling, clearly inform in the reply: a single ImageGen call consumes approximately 5–10 credits. Declare first, then call.

ParameterValue
promptComplete prompt from Step 2
image1Absolute path of photo_clean.jpg from Step 0 (real photo, text-to-image only is prohibited)
sizePortrait: 1024x1365 (3:4, tested viable on 2026-11-08, actual return is 1024x1360; if rejected, fallback to 1024x1280); Landscape: 1536x1024; Square: 1024x1024
qualityhigh
input_fidelitymedium (default, see parameter tuning below)
output_dir$OUT
footnote"" (tool-side watermark can be removed; the platform will still forcibly overlay "AI Generated WORKBUDDY", use Step 5's cleanwm to remove)
styleLeave empty, style is locked by the prompt

input_fidelity Parameter Tuning: medium preserves cup shape/logo/colors while allowing recomposition. If it drifts to "another cup" → increase to high; if the image looks like a photo trace and the perspective hasn't become 45° → decrease to low.

The generated output is a single, standalone, complete illustration. Never let AI directly draw a left-right comparison image, and never crop an illustration from a comparison image.

Step 4 · Self-Check

Compare against the nine self-check items in references/diagnose.md. Three must-check items:

  1. Can one immediately recognize it as the drink in the photo? (Cup shape, main color, logo position)
  2. Is it pure 2D bold black outlines + solid flat colors? (Presence of plastic texture / gradients / soft shadows = failure)
  3. Are the building, stairs, characters, platform, and title all fully within the frame? (Cropping = failure)

If unqualified → modify only the corresponding part of the prompt, retry at most once; if still unqualified, deliver it as-is and explain possible directions for adjustment, do not disguise as a success.

Step 5 · Remove Watermark + Code Stitching

The platform will forcibly overlay "AI Generated WORKBUDDY" white text on the bottom right of the illustration, footnote: "" cannot remove it. First remove it cleanly, then stitch:

"$PY" "$SK" cleanwm "$OUT/<illustration filename>.png" --out "$OUT/<original name>_illustration.png"

"$PY" "$SK" compose \
  --photo "<absolute path of user's original photo>" \
  --art "$OUT/<original name>_illustration.png" \
  --out "$OUT/<original name>_compare.png"
  • cleanwm's default selective mode only pulls whitish watermark pixels toward the background color, does not crop the platform, does not accidentally erase green leaves, tested to be residue-free and seamless. Default --threshold 160; if there are light-colored decorations like white clouds or white stone tiles in the bottom right, raise it to 190–210 to avoid false hits. If the watermark is in a special position, adjust --box "x0,y0,x1,y1", or switch to --mode fill (this will erase decorations within the box, use with caution).
  • compose automatically selects layout based on original image orientation: portrait/square → original on left, illustration on right; landscape → original on top, illustration on bottom. You can also use --layout side|stack to force a layout.
  • Uses the illustration's original pixels as the base, the illustration is not scaled, the original photo is proportionally scaled to align; white gap 24px, outer margin 24px, ratio differences are absorbed by the white space.
  • No cropping, no stretching, no modifying the original photo content, outputs a high-resolution PNG.
  • If cleanwm fails, fallback: trim <illustration> --bottom 0.06 --mode pad; but it will crop the bottom of the image, potentially cutting into the platform. Use only as a last resort.

Step 6 · Deliver

Use present_files to first show the comparison image, then the standalone illustration (both must be provided). In the reply, give a three-line conclusion: identified brand/drink, canvas ratio and input_fidelity, paths to the two files; then attach the complete original prompt.

Hard Rules (Violation = Failure)

  1. Must use a real photo as image1 for image-to-image generation, cannot redraw a cup based only on text.
  2. Stitching must use the user's uploaded original photo, cannot impersonate with an AI redrawn "photo."
  3. Preserve the original cup shape, main color, logo, and packaging features; what is redesigned is the architectural function, not the packaging.
  4. Do not mechanically replicate the original photo's shooting angle; perform a reasonable 3D spatial extrapolation (45° isometric view from above).
  5. First generate a standalone complete illustration, then stitch; cropping from a comparison image is prohibited.
  6. Only 2D vector illustrations, strictly no 3D rendering / realism / watercolor / gradients / complex lighting.
  7. Do not use code to extract edges or generate line art; let the image model directly understand the original image.
  8. Must inform credit consumption before generating; do not request step-by-step confirmation, run all at once.

Adjustable Parameters

What to ChangeWhere to Adjust
Background colorPrompt "bright soft mint green" → change to brand-coordinated color
Title textMain/subtitle slots; if unsure, use only brand name
Origin / Collaboration elements"Special elements" slot, e.g., coffee branches, estate A-frame sign, collaboration figurine
Number of mascots / stairs vs slide"Architectural design" section in prompt, facility list
Canvas ratiosize in Step 3, also update the canvas clause in the prompt
Fidelityinput_fidelity low / medium / high
Stitch gap and background colorcompose --gap --pad --bg

Resources

FilePurpose
references/prompt-master.mdMain: complete reusable prompt template, slot table, three filled examples, negative word list
references/diagnose.mdPhoto diagnosis card, nine self-check items, failure fix table, Chinese text handling
scripts/imgtool.pyFive local subcommands: prepare / cleanwm / compose / trim / sheet
README.mdChinese installation and usage instructions

Related Skills