Sticker Pack Maker (微信表情包制作)
Turn digital-human / reference sheets into a complete, upload-ready WeChat
sticker-album package. The pipeline below is proven end-to-end; the bundled
scripts are deterministic and reusable.
When to use
- "做个微信表情包" / "用数字人做表情" / "把参考图做成表情专辑"
- Need looping GIF emojis from AI frames
- Need to clean ImageGen artifacts, make transparent covers/icons, package for 微信表情开放平台
Pipeline (5 steps)
- Decide scope — count × actions. Example: 16 stickers × 2 actions (blink +
nod) = 32 AI generations (dropping a 3rd action like "shrug" simplifies cost). - Generate frames — ImageGen img2img from a reference grid. Expect ~32–48
raw PNGs at 1024×1024. - Clean frames — run
scripts/clean_frames.pyto strip the right-edge ghost
artifact and chroma-key the background to transparency. - Build GIFs — run
scripts/build_gifs.pywith a sticker→frames JSON map;
produces 5-frame loops (睁→眨→睁→点头→正) at 240×240. - Make covers + package —
scripts/make_cover.pyfor a solid-bg 240 cover and
scripts/crop_avatar.pyfor the 640 real-person avatar; assemble the upload
folder + zip.
Bundled scripts (run with the project's Pillow venv)
scripts/clean_frames.py [input_dir] [--out cleaned_dir]
Detects and removes the ImageGen right-edge ghost (cols ~959–1023) via
column-run gap detection, re-centers, then edge-floods near-background pixels
to transparent. See reference pitfalls #1, #2, #3.scripts/build_gifs.py --cleaned [dir] --map stickers.json --out [dir] [--static [dir]]
chroma-keys static bases, bbox-normalizes every frame (crop alpha bbox → scale
to 82% of 240 → center) to stop scale/position jitter, assembles the 5-frame
loop withloop=0, disposal=2, transparency=0, optimize=True. Keeps each GIF
under 500KB.scripts/make_cover.py [in] [out] --size 240 --text "专辑名" [--mode character|photo]
Composites a transparent character onto a solid engineering-blue gradient (or
square-crops a photo) with an opaque bottom text band. Avoids the
"floating transparent avatar" ugliness.scripts/crop_avatar.py [in] [out] --size 640
Center-crops any photo to a square and resizes for the platform's real-person
640×640 artist avatar.
Critical constraints (read before uploading)
Load references/wechat_sticker_spec.md for the full field table, upload steps,
and the 8 hard-won pitfalls. Highlights:
- Name ≤ 8 chars; intro ≤ 80 chars (the "≤11 char intro" rule circulating
online is wrong — verify against the live form). - Two different "avatars": 240×240 album cover (use a solid-bg image) AND
640×640 real-person artist avatar (AI art will likely be rejected). - Chat icon must be 50×50 and transparent; do NOT put a background on it.
- WeChat allows 16 main GIFs max, each under 500KB; "add works" binds to one
表情形象 with only 1 later change — upload all at once. - ImageGen
background:transparentdoes not work → chroma-key instead. - You (the agent) cannot see the images — rely on numpy pixel stats (density
grids, bbox, column runs) and always ask the user to eyeball sample GIFs.
Typical file layout produced
AI表情帧/cleaned/ → transparent RGBA frames (from clean_frames.py)
GIF动效/ → 16 *_loop.gif (from build_gifs.py)
上架包/ → 16 gifs + 封面.png + 聊天图标.png + 详情页横幅.png
+ 赞赏引导图.png + 致谢图.png + 头像_640.png + 上架清单.txt
上架包.zip → upload-ready archive