← 返回
未分类

Telegram Stickers

Create Telegram stickers from images — static PNG stickers or animated WebM video stickers. Use when the user wants to make, process, or package Telegram sti...
从图片创建Telegram贴纸——静态PNG贴纸或动态WebM视频贴纸。用于用户想要制作、处理或打包Telegram贴纸时。
saintsola13
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 236
下载
💾 0
安装
1
版本
#latest

概述

Telegram Stickers

Specs (official — core.telegram.org)

TypeFormatResolutionTransparentMax DurationMax File
------------------------------------------------------------
StaticPNG or WebP512×512Required512 KB
VideoWebM VP9 (yuva420p)512×512Required3 sec256 KB
AnimatedTGS (Lottie)512×512Required3 sec64 KB

> TGS = vector only. Never attempt TGS from raster/PNG — impossible under 64KB compressed. Requires original layered vector artwork in After Effects. For NFT/photo art → use WebM video stickers.


Quickstart — One-Shot Script

For most requests, use sticker.py which handles the full pipeline in one command:

# Static PNG sticker
python3 scripts/sticker.py <image>

# Animated WebM sticker
python3 scripts/sticker.py <image> --animate sway    # gentle side-to-side
python3 scripts/sticker.py <image> --animate bounce  # energetic bounce
python3 scripts/sticker.py <image> --animate shake   # fast hype jitter

# Skip upload (local file only)
python3 scripts/sticker.py <image> --animate sway --no-upload

Output: _sticker.png (static) or _.webm + tmpfiles.org download URL (animated).


Individual Scripts

Use these when you need fine-grained control or are processing in bulk.

1. Background removal + resize → PNG

python3 scripts/make_sticker.py <input_image> [output.png]
  • Uses rembg u2net model (cached at ~/.u2net/u2net.onnx after first run — ~170MB download)
  • Crops to content → thumbnail to 512×512 → centers on transparent canvas → saves as PNG
  • Warns if output exceeds 512KB

2. Generate animation frames

python3 scripts/animate_sway.py   <sticker.png> [--fps 24] [--duration 2.0] [--shift 18] [--angle 4] [--outdir frames_sway]
python3 scripts/animate_bounce.py <sticker.png> [--fps 24] [--duration 1.5] [--height 20] [--outdir frames_bounce]
python3 scripts/animate_shake.py  <sticker.png> [--fps 24] [--duration 1.0] [--intensity 10] [--outdir frames_shake]

Input must be a processed 512×512 transparent PNG (output of make_sticker.py).

3. Encode frames → WebM + upload

python3 scripts/make_webm.py <frames_dir> [output.webm] [--fps 24] [--duration 2.0] [--no-upload]
  • Encodes VP9 WebM with transparent background (yuva420p)
  • Validates duration ≤ 3s and size ≤ 256KB
  • Auto-uploads to tmpfiles.org, prints direct download URL (expires ~1hr)
  • Do NOT add -loop 0 — GIF flag, breaks WebM

Uploading to Telegram

After generating the file, upload via tmpfiles.org (already handled by make_webm.py / sticker.py):

curl -s -F "file=@sticker.png" https://tmpfiles.org/api/v1/upload
# Returns JSON → insert /dl/ after tmpfiles.org/ in the URL for direct download

See references/stickers-bot-guide.md for full @Stickers bot step-by-step.

Key rule: always send sticker files to @Stickers bot as a Document, not a photo. Telegram compresses photos to JPEG and destroys transparency.


@Stickers Bot — Quick Reference

Pack typeBot commandFile format
------------------------------------
Static/newpackPNG sent as Document
Video stickers/newvideoWebM sent as Document

Static and video packs are separate — cannot mix types in one pack.


Dependencies

pip install "rembg[cpu]" Pillow numpy
# ffmpeg with libvpx-vp9 (system-wide install)

sticker.py runs a dependency check on startup and prints install hints if anything is missing.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-20 05:50 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

security-compliance

Skill Vetter

spclaudehome
AI智能体技能安全预审工具。安装ClawdHub、GitHub等来源技能前,检查风险信号、权限范围及可疑模式。
★ 1,218 📥 266,734
ai-intelligence

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,362 📥 318,869
ai-intelligence

self-improving agent

pskoett
捕获经验教训、错误和纠正,以实现持续改进。使用时机:(1)命令或操作意外失败;(2)用户纠正……
★ 4,060 📥 798,766