← 返回 Skills 市场
168
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install avatar-generator
功能描述
Generate customizable avatars in six styles with multi-platform export for social media including WeChat, QQ, Twitter, and Discord.
使用说明 (SKILL.md)
Avatar Generator
Professional avatar generator with 6 styles, multi-platform export, and customizable options.
Features
- 🎨 6 Avatar Styles: Letter, Geometric, Gradient, Abstract, Pattern, Badge
- 📱 Multi-Platform: Auto-export for 9+ platforms
- 🎯 Customizable: Colors, shapes, sizes, fonts
- ⚡ Fast Generation: Local Pillow rendering
- 🌍 Multi-Language: Chinese and English support
Supported Platforms
| Platform | Size | Shape | Priority |
|---|---|---|---|
| 640×640 | Square | ⭐⭐⭐⭐⭐ | |
| 100×100 | Square | ⭐⭐⭐⭐⭐ | |
| Xiaohongshu | 400×400 | Round | ⭐⭐⭐⭐ |
| 200×200 | Round | ⭐⭐⭐⭐ | |
| Twitter/X | 400×400 | Round | ⭐⭐⭐⭐ |
| Discord | 128×128 | Round | ⭐⭐⭐ |
| 256×256 | Round | ⭐⭐⭐ | |
| 170×170 | Round | ⭐⭐⭐ | |
| 400×400 | Square | ⭐⭐⭐ |
Avatar Styles
1. Letter Avatar (Initial Letter)
- Single letter or initials
- Clean background
- Professional look
- Best for: Business, professional
2. Geometric Avatar
- Abstract shapes
- Modern design
- Eye-catching
- Best for: Tech, creative
3. Gradient Avatar
- Smooth color transitions
- Trendy look
- Customizable
- Best for: Social media
4. Abstract Avatar
- Artistic patterns
- Unique design
- Stand out
- Best for: Creative, personal
5. Pattern Avatar
- Repeating elements
- Structured design
- Brand identity
- Best for: Teams, companies
6. Badge Avatar
- Circular frame
- Official look
- Identity badge
- Best for: Certification, ID
Trigger Conditions
- "Generate avatar" / "生成头像"
- "Create WeChat avatar" / "做微信头像"
- "Make social media avatar" / "生成社交头像"
- "avatar-generator"
Python Code
from PIL import Image, ImageDraw, ImageFont
import os
import colorsys
import random
class AvatarGenerator:
def __init__(self):
self.platforms = {
'wechat': {'size': (640, 640), 'shape': 'square'},
'qq': {'size': (100, 100), 'shape': 'square'},
'xiaohongshu': {'size': (400, 400), 'shape': 'round'},
'weibo': {'size': (200, 200), 'shape': 'round'},
'twitter': {'size': (400, 400), 'shape': 'round'},
'discord': {'size': (128, 128), 'shape': 'round'},
'reddit': {'size': (256, 256), 'shape': 'round'},
'facebook': {'size': (170, 170), 'shape': 'round'},
'linkedin': {'size': (400, 400), 'shape': 'square'},
}
def _load_font(self, size):
"""Load font with fallback"""
paths = [
'/System/Library/Fonts/PingFang.ttc',
'/System/Library/Fonts/STHeiti Light.ttc',
'/usr/share/fonts/truetype/noto/NotoSansCJK-Regular.ttc',
]
for p in paths:
if os.path.exists(p):
try:
return ImageFont.truetype(p, size)
except:
continue
return ImageFont.load_default()
def create_letter_avatar(self, letter, bg_color, text_color, size=(400, 400)):
"""Style 1: Letter avatar"""
img = Image.new('RGB', size, bg_color)
draw = ImageDraw.Draw(img)
font = self._load_font(size[0] // 2)
bbox = draw.textbbox((0, 0), letter, font=font)
w, h = bbox[2] - bbox[0], bbox[3] - bbox[1]
x, y = (size[0] - w) // 2, (size[1] - h) // 2
draw.text((x, y), letter, font=font, fill=text_color)
return img
def create_geometric_avatar(self, colors, size=(400, 400)):
"""Style 2: Geometric avatar"""
img = Image.new('RGB', size, colors[0])
draw = ImageDraw.Draw(img)
# Add geometric shapes
center = size[0] // 2
draw.ellipse([(50, 50), (size[0]-50, size[1]-50)], fill=colors[1])
draw.regular_polygon((center, center, size[0]//3), 6, fill=colors[2])
return img
def create_gradient_avatar(self, color1, color2, size=(400, 400)):
"""Style 3: Gradient avatar"""
import numpy as np
img = np.zeros((size[1], size[0], 3), dtype=np.uint8)
for y in range(size[1]):
ratio = y / size[1]
r = int(color1[0] * (1-ratio) + color2[0] * ratio)
g = int(color1[1] * (1-ratio) + color2[1] * ratio)
b = int(color1[2] * (1-ratio) + color2[2] * ratio)
img[y, :] = [r, g, b]
return Image.fromarray(img)
def create_abstract_avatar(self, seed, colors, size=(400, 400)):
"""Style 4: Abstract avatar"""
random.seed(seed)
img = Image.new('RGB', size, colors[0])
draw = ImageDraw.Draw(img)
for _ in range(10):
x, y = random.randint(0, size[0]), random.randint(0, size[1])
r = random.randint(20, 100)
color = random.choice(colors[1:])
draw.ellipse([(x-r, y-r), (x+r, y+r)], fill=color)
return img
def create_pattern_avatar(self, pattern_type, colors, size=(400, 400)):
"""Style 5: Pattern avatar"""
img = Image.new('RGB', size, colors[0])
draw = ImageDraw.Draw(img)
cell_size = 40
for x in range(0, size[0], cell_size):
for y in range(0, size[1], cell_size):
if (x // cell_size + y // cell_size) % 2 == 0:
draw.rectangle([(x, y), (x+cell_size, y+cell_size)], fill=colors[1])
return img
def create_badge_avatar(self, text, bg_color, border_color, size=(400, 400)):
"""Style 6: Badge avatar"""
img = Image.new('RGB', size, (255, 255, 255))
draw = ImageDraw.Draw(img)
# Draw circular badge
margin = 20
draw.ellipse([(margin, margin), (size[0]-margin, size[1]-margin)],
fill=bg_color, outline=border_color, width=5)
# Add text
font = self._load_font(size[0] // 4)
bbox = draw.textbbox((0, 0), text, font=font)
w, h = bbox[2] - bbox[0], bbox[3] - bbox[1]
x, y = (size[0] - w) // 2, (size[1] - h) // 2
draw.text((x, y), text, font=font, fill='white')
return img
def make_round(self, img):
"""Make image circular"""
size = img.size
mask = Image.new('L', size, 0)
draw = ImageDraw.Draw(mask)
draw.ellipse([(0, 0), size], fill=255)
result = Image.new('RGBA', size, (0, 0, 0, 0))
result.paste(img, mask=mask)
return result
def export_multi_platform(self, img, output_dir, platforms=None):
"""Export for multiple platforms"""
os.makedirs(output_dir, exist_ok=True)
if platforms is None:
platforms = list(self.platforms.keys())
exported = []
for platform in platforms:
if platform in self.platforms:
config = self.platforms[platform]
resized = img.resize(config['size'], Image.LANCZOS)
if config['shape'] == 'round':
resized = self.make_round(resized)
path = os.path.join(output_dir, f'avatar_{platform}.png')
resized.save(path)
exported.append(path)
return exported
# Example usage
gen = AvatarGenerator()
# Letter avatar
avatar1 = gen.create_letter_avatar('Z', (30, 60, 114), (255, 255, 255))
# Gradient avatar
avatar2 = gen.create_gradient_avatar((67, 142, 219), (30, 60, 114))
# Export to all platforms
gen.export_multi_platform(avatar1, 'output/')
Usage Examples
User: "Generate a WeChat avatar with blue background and white Z"
Agent: Create 640×640 letter avatar
User: "Make a gradient avatar for Xiaohongshu"
Agent: Create 400×400 round gradient avatar
User: "Create social media avatars"
Agent: Generate avatars for all platforms
Notes
- All avatars generated locally with Pillow
- No external API required
- Cross-platform compatible
- Supports Chinese and English text
安全使用建议
This skill appears to be a straightforward local avatar generator, but take these precautions before using it: (1) The skill source is unknown and has no homepage — review the SKILL.md and embedded code yourself. (2) Ensure you have Python 3 installed and install required packages: at minimum Pillow, and also numpy (the code imports numpy for gradients). (3) The code will read system font files (to render text) and will write image files to disk — run it in a safe/sandboxed environment if you are concerned about file access. (4) There are minor metadata inconsistencies (registry says no required binaries while SKILL.md lists python3; dependency list omits numpy) — fix these before running to avoid runtime errors. (5) No network calls or credential access were found in the provided files, but if the skill is later modified to add export/upload features, re-check for endpoints or secret usage.
功能分析
Type: OpenClaw Skill
Name: avatar-generator
Version: 1.0.0
The avatar-generator skill is a legitimate tool for creating profile pictures using the Pillow library. The Python code in SKILL.md implements various drawing styles (letter, geometric, gradient) and exports them to standard platform sizes locally. There are no indicators of data exfiltration, malicious execution, or prompt injection; the code only interacts with standard system font paths and the local filesystem for saving generated images.
能力评估
Purpose & Capability
The SKILL.md, description, and embedded Python code all implement an avatar generator (letter, geometric, gradient, abstract, pattern, badge) and auto-exporting to multiple platform sizes — consistent with the stated purpose. Minor mismatch: registry metadata earlier declared no required binaries, but SKILL.md metadata lists python3 as a required binary.
Instruction Scope
Instructions and the included Python code perform only local image rendering and file operations (Pillow, drawing, randomization, resizing, saving). The code attempts to load system font files (paths under /System/Library and /usr/share/fonts), which means it will read system font files if present. It does not reference network endpoints or request secrets. The gradient routine imports numpy, but the SKILL.md dependency text only lists Pillow — that dependency mismatch is a runtime correctness issue (not a direct security red flag) but worth fixing.
Install Mechanism
This is an instruction-only skill with no install spec; nothing is auto-downloaded or written by an installation step. SKILL.md suggests 'pip install pillow' but provides no automated install. No external URLs or archive downloads are used.
Credentials
The skill does not request any environment variables, credentials, or config paths beyond reading typical system font paths. No tokens/keys/passwords are requested — proportional to its purpose.
Persistence & Privilege
always is false and there are no special persistence requests. The skill does not attempt to modify other skills or agent system settings.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install avatar-generator - 安装完成后,直接呼叫该 Skill 的名称或使用
/avatar-generator触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
专业头像生成器:6种风格,支持9+社交平台,多尺寸导出
元数据
常见问题
Avatar Generator 是什么?
Generate customizable avatars in six styles with multi-platform export for social media including WeChat, QQ, Twitter, and Discord. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 168 次。
如何安装 Avatar Generator?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install avatar-generator」即可一键安装,无需额外配置。
Avatar Generator 是免费的吗?
是的,Avatar Generator 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Avatar Generator 支持哪些平台?
Avatar Generator 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Avatar Generator?
由 ToBeWin(@tobewin)开发并维护,当前版本 v1.0.0。
推荐 Skills