image-processing
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese图片处理 Skill
Image Processing Skill
你是一个图片处理助手,负责为配图添加文字标注和装饰效果。
You are an image processing assistant responsible for adding text annotations and decorative effects to images.
核心能力
Core Capabilities
- 底部边框式配文:在图片下方添加独立的文字区域,类似画框效果
- 内部贴纸式配文:在图片内部添加带背景的文字标签,类似小红书贴纸效果
- 中文支持:使用 Windows 系统自带的微软雅黑字体
- Emoji 支持:使用 pilmoji 库渲染 Emoji 表情
- Bottom Frame Caption: Add an independent text area below the image, similar to a picture frame effect
- Internal Sticker Caption: Add text labels with background inside the image, similar to Xiaohongshu sticker effect
- Chinese Support: Use the built-in Microsoft YaHei font of Windows system
- Emoji Support: Use the pilmoji library to render Emoji expressions
使用方式
Usage
模式 1:底部边框式配文
Mode 1: Bottom Frame Caption
在图片下方添加白色/深色背景的文字区域:
bash
python scripts/image_processor.py input.jpg output.jpg --mode frame --text "这是配文 🎉"效果示例:
┌────────────────────┐
│ │
│ 原图片 │
│ │
├────────────────────┤
│ 这是配文 🎉 │
└────────────────────┘参数:
- :边框模式
--mode frame - :配文内容(支持中文和 Emoji)
--text - :背景颜色(默认
--bg-color,可用white、black)#RRGGBB - :文字颜色(默认
--text-color)black - :字体大小(默认 32)
--font-size - :内边距(默认 20)
--padding
Add a text area with white/dark background below the image:
bash
python scripts/image_processor.py input.jpg output.jpg --mode frame --text "这是配文 🎉"Effect Example:
┌────────────────────┐
│ │
│ Original Image│
│ │
├────────────────────┤
│ 这是配文 🎉 │
└────────────────────┘Parameters:
- : Frame mode
--mode frame - : Caption content (supports Chinese and Emoji)
--text - : Background color (default
--bg-color, available options:white,black)#RRGGBB - : Text color (default
--text-color)black - : Font size (default 32)
--font-size - : Inner padding (default 20)
--padding
模式 2:内部贴纸式配文
Mode 2: Internal Sticker Caption
在图片内部指定位置添加带背景的文字标签:
bash
python scripts/image_processor.py input.jpg output.jpg --mode sticker --text "重点!" --position bottom-right效果示例:
┌────────────────────┐
│ │
│ 原图片 ┌───┤
│ │重点│
└───────────────┴───┘参数:
- :贴纸模式
--mode sticker - :配文内容
--text - :位置,可选
--position、top-left、top-right、bottom-left、bottom-rightcenter - :标签背景色(默认
--bg-color,浅橙色)#FFE4B5 - :文字颜色(默认
--text-color)#333333 - :字体大小(默认 28)
--font-size - :背景透明度 0-255(默认 230)
--opacity - :圆角半径(默认 10)
--radius - :距边缘距离(默认 20)
--margin
Add text labels with background at specified positions inside the image:
bash
python scripts/image_processor.py input.jpg output.jpg --mode sticker --text "重点!" --position bottom-rightEffect Example:
┌────────────────────┐
│ │
│ Original Image ┌───┤
│ │重点│
└───────────────┴───┘Parameters:
- : Sticker mode
--mode sticker - : Caption content
--text - : Position, optional values:
--position,top-left,top-right,bottom-left,bottom-rightcenter - : Label background color (default
--bg-color, light orange)#FFE4B5 - : Text color (default
--text-color)#333333 - : Font size (default 28)
--font-size - : Background transparency 0-255 (default 230)
--opacity - : Rounded corner radius (default 10)
--radius - : Distance from the edge (default 20)
--margin
批量处理
Batch Processing
处理多张图片:
bash
python scripts/image_processor.py ./images/*.jpg --output-dir ./output --mode frame --text "配文"Process multiple images:
bash
python scripts/image_processor.py ./images/*.jpg --output-dir ./output --mode frame --text "配文"字体配置
Font Configuration
脚本会按以下顺序查找中文字体:
- - 微软雅黑
C:/Windows/Fonts/msyh.ttc - - 黑体
C:/Windows/Fonts/simhei.ttf - - 宋体
C:/Windows/Fonts/simsun.ttc - 系统默认字体(可能不支持中文)
如需使用自定义字体:
bash
python scripts/image_processor.py input.jpg output.jpg --font "C:/MyFonts/custom.ttf" --text "配文"The script will search for Chinese fonts in the following order:
- - Microsoft YaHei
C:/Windows/Fonts/msyh.ttc - - SimHei
C:/Windows/Fonts/simhei.ttf - - SimSun
C:/Windows/Fonts/simsun.ttc - System default font (may not support Chinese)
To use a custom font:
bash
python scripts/image_processor.py input.jpg output.jpg --font "C:/MyFonts/custom.ttf" --text "配文"颜色参考
Color Reference
常用颜色值:
| 名称 | 代码 | 用途 |
|---|---|---|
| 白色 | | 边框背景 |
| 黑色 | | 深色背景/文字 |
| 浅橙 | | 贴纸背景 |
| 浅蓝 | | 贴纸背景 |
| 浅绿 | | 贴纸背景 |
| 浅粉 | | 贴纸背景 |
Common color values:
| Name | Code | Usage |
|---|---|---|
| White | | Frame background |
| Black | | Dark background/text |
| Light Orange | | Sticker background |
| Light Blue | | Sticker background |
| Light Green | | Sticker background |
| Light Pink | | Sticker background |
与其他 Skill 配合
Cooperation with Other Skills
- 使用 图片搜索 Skill 找到合适的配图
- 使用本 Skill 添加配文
- 在 通用写作 Skill 中引用处理后的图片
- Use Image Search Skill to find suitable images
- Use this Skill to add captions
- Reference the processed images in General Writing Skill
注意事项
Notes
- 图片格式:支持 JPG、PNG、WEBP 等常见格式
- 输出格式:根据输出文件扩展名自动选择格式
- Emoji 渲染:需要安装 pilmoji 库
- 字体权限:确保对字体文件有读取权限
- Image Format: Supports common formats such as JPG, PNG, WEBP
- Output Format: Automatically select the format based on the output file extension
- Emoji Rendering: Need to install the pilmoji library
- Font Permissions: Ensure you have read permissions for the font files