WeChat Sticker Transparent 240 Grid Version
This skill is an independent grid-based derivative of wechat-sticker-transparent-240. It retains the original skill's transparent PNG, light/dark check, animation prompts, and video/GIF pay gate, but changes the static image generation flow to:
One food reference image
↓
Generate one 3×3 grid master image in a single pass
↓
Restore true transparency / ensure safe margins
↓
Split equally into 9 keyed source images
↓
Skill script outputs 9 240×240 and 9 500×500 transparent PNGs
When the user only asks for individual sticker generation, use the original skill; only use this skill when the user explicitly requests "grid", "3×3 master image then split".
Do Not Modify the Original Skill
This skill must keep /Users/alex.feng/微信表情包/.codex/skills/wechat-sticker-transparent-240/ unchanged. The new skill uses its own copies of scripts/ and references/; do not write grid logic back into the original skill.
English documentation is maintained alongside this Chinese operational skill in README.md and SKILL.en.md. The English companion must describe the same scope, gates, file formats, and MP4-to-GIF behavior; update both language versions when changing the workflow.
Input Type Routing: Images, Existing MP4, AI-Generated Video
First determine the medium delivered by the user; do not mix the three routes:
- Image input: Follow this skill's grid master image, transparency restoration, equal split, and 240/500 PNG workflow.
- User has already provided an MP4 and requests cropping it into a WeChat sticker: Treat the MP4 as an existing animation source, directly enter the "MP4 to WeChat transparent GIF" route; do NOT call
image_gen, video generation platforms, or any paid video API. Keep the original MP4, do not overwrite or regenerate the animation. - User only says "check MP4" or provides the file without requesting conversion: Keep read-only, do not extract frames, crop, or generate a GIF.
- User requests animation from static images: Only then enter the AI video generation pay gate; after generation is complete, process the GIF according to separate rules.
The existing MP4 GIF route still reuses this skill's own scripts/prepare_transparent_gifs.py and references/animation-video-workflow.md: remove flat background connected to edges frame by frame, keep white cream, eyes, highlights, and light decorations, output 240×240, infinite loop, all frames with transparent pixels, strictly less than 500000 bytes per GIF. If the MP4 is a 3×3 animated master sheet, it must first be split into 9 separate frame sequences per frame using the same grid boundaries and 24px safe margin, then each encoded as 9 GIFs; do not shrink the entire grid into one GIF, nor crop only the first frame.
Phase One: Align First, Then Generate
Before starting image generation, confirm:
- The reference image and the name of the main food subject;
- Whether it is completely free of text, letters, numbers, logos, and watermarks;
- The expression/action range for each of the nine cells;
- Whether Emoji are used as visual elements or displayed as Unicode characters; default to visual elements like sunglasses, tongue-out, hearts, rockets, party hats, do not render Emoji as text;
- Whether the delivery is static only, or also needs subsequent video/GIF.
- If the delivery medium is an existing MP4, confirm whether it is "direct conversion to WeChat transparent GIF" and not regeneration of video; when the user explicitly requests conversion, do not ask about AI video authorization.
Do not repeatedly ask about grid requirements the user has already specified. The user's grid workflow takes priority over the original skill's general rule of "generate each subject individually".
Fixed English Style Template and Random Reaction Library
The following English text is this skill's fixed style template. It must be kept verbatim and included in every final English prompt submitted to the image generation tool:
Create a Meme sticker pack based on the images attached, remixing with 😎😛💕🚀🥳. Use exaggerated internet-reaction expressions, including crying, confusion, shock, smugness, side-eye, and deadpan disbelief, with awkward poses, low-fi cutout textures, and absurd humor.
Create a single square(1:1) transparent sticker sheet with nine distinct stickers arranged in a 3×3 grid, each showing a different expression, pose, or reaction. Separate the stickers with wide, fully transparent gaps. No background, shadows, or overlapping elements.
This fixed template locks the overall style, but does not lock the specific nine cells for each round. Each time, append the 9 randomly selected English reaction descriptions for that round, plus dynamic constraints such as the reference image, no text, Emoji visual elements, border safety margin, etc. The dynamic nine-cell list takes priority in determining the specific content for that round.
The reaction library is fixed as the following 24 candidates. Chinese is used for alignment with the user; the English short phrase is used to form the final image generation prompt:
| Category | Chinese Reaction | English prompt cue |
|---|---|---|
| Crying | 奶酪眼泪大哭 | huge crying reaction with stretchy melted-cheese tears |
| Crying | 泪崩缩成一团 | collapsed sobbing reaction, curled into an awkward ball |
| Crying | 委屈啜泣 | hurt pout and tiny sobbing reaction |
| Crying | 崩溃嚎叫 | overwhelmed meltdown with a wide wailing mouth |
| Crying | 边哭边擦眼泪 | crying while clumsily wiping away tears |
| Crying | 感动到失控 | overwhelmed by emotion, joyful tears and trembling hands |
| Confused/Shocked | 困惑歪头 | confused tilted-head reaction with mismatched uncertain eyes |
| Confused/Shocked | 脑袋宕机 | brain-frozen reaction with blank unfocused eyes |
| Confused/Shocked | 瞳孔地震 | extreme shock with trembling oversized pupils |
| Confused/Shocked | 惊恐后退 | startled recoil with awkward backward steps |
| Confused/Shocked | 灵魂出窍 | stunned spirit-leaving-the-body reaction, absurd and harmless |
| Confused/Shocked | 被吓到僵住 | frozen in place after a harmless surprise |
| Attitude/Suspicion | 得意墨镜 | smug reaction with oversized dark sunglasses, inspired by 😎 |
| Attitude/Suspicion | 挑眉自信 | cocky raised-eyebrow reaction with an awkward confident pose |
| Attitude/Suspicion | 尴尬侧目 | awkward side-eye while leaning away |
| Attitude/Suspicion | 死鱼眼怀疑 | deadpan disbelief with a flat unimpressed stare |
| Attitude/Suspicion | 无语摊手 | speechless shrug with helpless open hands |
| Attitude/Suspicion | 扶额不敢相信 | forehead-covering disbelief, quietly horrified but harmless |
| Goofy/Absurd | 吐舌搞怪 | goofy tongue-out reaction, inspired by 😛 |
| Goofy/Absurd | 社恐躲避 | shy social-avoidance pose hiding awkwardly behind itself |
| Goofy/Absurd | 尴尬石化 | embarrassed petrified reaction with stiff tiny limbs |
| Goofy/Absurd | 偷偷观察 | sneaky peek from the side with nervous curious eyes |
| Goofy/Absurd | 摆烂躺平 | completely defeated lying-flat reaction, absurdly relaxed |
| Goofy/Absurd | 假装没看见 | pretending not to notice with a deliberately blank face |
Random selection rules:
- Each round, randomly select 9 from the 24 candidates by default; no repeats within the same round;
- To maintain the emotional distribution of the grid, each of the four categories must have at least 1 selected, then randomly fill the remaining 5 from the remaining candidates;
- When the user specifies certain reactions, the user's specified content takes priority; fill the remaining cells randomly;
- Record the actual selected Chinese names, English cues, and random results in
生图提示词.mdfor reproducibility and review; - These 9 random reactions are not video authorization and do not skip the subsequent English prompt confirmation.
English prompt confirmation gate: After random selection is complete, first show the user the 9 Chinese reactions for this round, then show the complete final English prompt. Do not call image_gen before receiving an explicit "confirm execution" or equivalent clear instruction from the user. Only after confirmation generate one grid master image.
Generate the Grid Master Image
Use the built-in image_gen, unless the user explicitly chooses CLI/API. Check the reference image with view_image first; treat the local reference image as the reference subject, do not mistake it as nine separate inputs.
Submit only one grid master image generation task; do not generate nine separate images with the same prompt. The final English prompt must first contain the fixed English template above verbatim, then append the 9 randomly selected English prompt cues for this round and the following constraints:
- Output a single 1:1 square master image, strictly 3×3 equally sized cells;
- Each of the nine cells contains only one independent subject, content does not cross the third dividing line;
- All eyes, hands, feet, tears, hearts, toppings, confetti, hats, rockets, and cheese strings are at least ~28px away from the cell boundaries;
- There are wide, fully transparent gaps between cells; no grid lines, borders, white backgrounds, shadows, glows, ground, reflections, or overlaps;
- The subject food maintains recognizable proportions, color palette, toppings, and hand-drawn/cutout texture;
- The nine expressions are truly different, covering the user-specified reactions such as crying, confusion, shock, smug, side-eye, deadpan disbelief;
- Emoji are only translated into visual elements; no Unicode characters appear;
- Absolutely no Chinese, English, letters, numbers, punctuation, subtitles, speech bubbles, logos, signatures, or watermarks in the image.
After generation, immediately check the file: do not mistake the checkerboard displayed by the viewer as true alpha. If the file is RGB and the checkerboard is baked into the image, use scripts/extract_grid_sheet.py to restore transparency; if the file already has true alpha, the script preserves it.
If the master image is not square, not divisible by 3, the cells are not equal, or expressions are cropped at the boundaries, stop and regenerate or fix the master image first; do not blindly split.
Restore Transparency, Shrink Safety Margin, and Split
extract_grid_sheet.py will:
- Identify and remove baked light checkerboard from the outer boundaries;
- Preserve foreground white cheese, eyes, and light highlights;
- Evenly scale down and center each cell, keeping a default 24px transparent safety margin;
- Keep the full single-cell canvas; do not auto-crop to alpha bounding box;
- Output a transparent master image, 9 full-cell transparent source images, and 9 magenta keyed source images.
This script requires Pillow, numpy, and cv2 to be importable in the current environment; if dependencies are missing, first report and install them; do not replace checkerboard restoration with a broad color removal.
When the foreground contains green ingredients such as green peppers or basil, use #ff00ff magenta key background by default; do not use a green key to avoid removing natural ingredients. Example:
python3 scripts/extract_grid_sheet.py \
master/theme-grid-generated.png \
--transparent-sheet master/theme-grid-transparent.png \
--transparent-crops master/split-transparent-sources \
--keyed-crops chroma-sources \
--base-name theme \
--labels crying confused shocked smug goofy side-eye deadpan heart rocket \
--key-color '#ff00ff' \
--safe-margin 24
File names use the Chinese food name as the base and differentiate the nine cells with an expression suffix, e.g., 01-Chicago-deep-dish-pizza-crying.png. The subject food name must appear consistently in the source images, 240, 500, animation prompt title, first frame file name, and 文案.txt.
Transparent 240/500 Output
Output two sizes for each of the 9 magenta keyed source images in chroma-sources/. Must use this skill's own script copy:
python3 scripts/prepare_transparent_stickers.py \
chroma-sources/*.png \
--out-dir transparent-240 \
--sizes 240
python3 scripts/prepare_transparent_stickers.py \
chroma-sources/*.png \
--out-dir transparent-500 \
--sizes 500
If inspection reveals obvious keying residue edges, only allow re-running the entire batch once with --edge-contract 1. Do not cut based on white, brightness, saturation, or "looks green" ranges; white cheese, eyes, light highlights, and natural green toppings must all be preserved.
If an extremely small amount of precise low-alpha #ff00ff residue remains, run a single surgical cleanup:
python3 scripts/clean_exact_key_residue.py \
transparent-240 transparent-500 \
--key-color '#ff00ff' \
--alpha-max 2
This script only deletes pixels that simultaneously satisfy "exactly equal to the key color" and "alpha not above the threshold"; do not turn it into a broad color removal.
Static Validation and Preview
Use the built-in validation script to check:
python3 scripts/validate_grid_pack.py \
--source-dir chroma-sources \
--dir-240 transparent-240 \
--dir-500 transparent-500 \
--master master/theme-grid-transparent.png \
--key-color '#ff00ff' \
--safe-margin 24
Validation must simultaneously prove:
chroma-sources/contains exactly 9 files;transparent-240/contains exactly 9 files, all strictly 240×240, RGBA;transparent-500/contains exactly 9 files, all strictly 500×500, RGBA;- Each image has four corner alpha = 0 and non-empty subject alpha;
- Final transparent images have no visible exact key color residue;
- Master image is square RGBA, with the safety zone near the 3×3 dividing lines fully transparent;
- Nine content, file names, numbers, and animation prompts correspond one-to-one.
Generate light and dark previews:
python3 scripts/make_grid_previews.py \
--master master/theme-grid-transparent.png \
--dir-500 transparent-500 \
--out-dir previews
Must visually inspect light and dark previews to confirm no white rectangular backgrounds, checkerboards, magenta edge residues, cropped hearts/rockets/toppings, and that white cheese is visible on dark backgrounds.
Prompts, Copywriting, and Static Delivery
Save the final prompt actually submitted to the image generation tool:
- Place
生图提示词.mdin the project delivery directory; - Place another copy in the default image generation output directory
/Users/alex.feng/.codex/generated_images/<task directory>/; - After redoing image generation, keep only the final accepted prompt; do not treat failed versions as the final specification.
Write one independent 4-second animation prompt for each of the 9 completed outputs and save as 动画提示词.md. Each must declare the corresponding 500 image as the first frame, fixed camera, maintain composition and character unchanged, 1–3 small actions, natural loop from beginning to end, no new text/characters/backgrounds/camera movements. When the image has no text, the animation prompt must also not add text.
Recommended delivery structure:
theme-grid-version/
├── master/
│ ├── theme-grid-generated.png
│ └── theme-grid-transparent.png
├── chroma-sources/ # 9 magenta keyed source images
├── transparent-240/ # 9 240×240 RGBA
├── transparent-500/ # 9 500×500 RGBA
├── previews/
├── video/ # Existing MP4, saved flat, do not overwrite original file
│ └── number-theme.mp4
├── transparent-GIF/ # 240×240 transparent GIFs from MP4 route
│ └── transparent-frames/ # Frame extraction check directory
├── 生图提示词.md
├── 动画提示词.md
└── 文案.txt
Pay Gate
Must stop after static PNGs, previews, validation, and animation prompts are complete. Even if the user initially mentioned animation, do not automatically:
- Upload images to a video platform;
- Submit a trial or formal video task;
- Call an API that might deduct credits;
- Treat GIF conversion as part of the static workflow.
Only when the next step is AI video generation, wait for the user to explicitly reply with "confirm execution", "start generating video", or an equivalent clear instruction, then read animation-video-workflow.md and enter the paid video stage. After all videos are downloaded, stop again and wait for the user's explicit confirmation for GIF conversion.
If the user has already provided an MP4 and explicitly requested GIF conversion, do not enter the pay video gate; read the "Existing MP4 → Transparent GIF" route in the same reference file, and directly perform frame-by-frame cropping, transparency, compression, and validation. As long as the MP4 is an existing file delivered by the user, conversion itself does not constitute video generation and does not require calling a video generation API. Regardless of source, the original MP4 must be preserved, and GIFs must still meet the requirements: 240×240, approximately 4 seconds, infinite loop, all frames transparent, strictly less than 500000 bytes.