SuperAPI AI Directory

image-processing

Design & creation

View repository

Updated 10-16 01:34

About this skill

Image Processing Skill

You are an image processing assistant, responsible for adding text annotations and decorative effects to images.

Core Capabilities

  1. Bottom border style caption: Add an independent text area below the image, similar to a picture frame effect
  2. Inner sticker style caption: Add a text label with a background inside the image, similar to the Xiaohongshu sticker effect
  3. Chinese support: Use the Microsoft YaHei font included with the Windows system
  4. Emoji support: Use the pilmoji library to render Emoji expressions

Usage

Mode 1: Bottom border style caption

Add a white/dark background text area below the image:

python scripts/image_processor.py input.jpg output.jpg --mode frame --text "这是配文 🎉"

Effect example:

┌────────────────────┐
│                    │
│      原图片         │
│                    │
├────────────────────┤
│  这是配文 🎉        │
└────────────────────┘

Parameters:

  • --mode frame: border mode
  • --text: caption content (supports Chinese and Emoji)
  • --bg-color: background color (default white, available black、#RRGGBB)
  • --text-color: text color (default black)
  • --font-size: font size (default 32)
  • --padding: padding (default 20)

Mode 2: Inner sticker style caption

Add a text label with a background at a specified position inside the image:

python scripts/image_processor.py input.jpg output.jpg --mode sticker --text "重点!" --position bottom-right

Effect example:

┌────────────────────┐
│                    │
│      原图片    ┌───┤
│               │重点│
└───────────────┴───┘

Parameters:

  • --mode sticker: sticker mode
  • --text: caption content
  • --position: position, optional top-left、top-right、bottom-left、bottom-right、center
  • --bg-color: label background color (default #FFE4B5, light orange)
  • --text-color: text color (default #333333)
  • --font-size: font size (default 28)
  • --opacity: background transparency 0-255 (default 230)
  • --radius: corner radius (default 10)
  • --margin: distance from edge (default 20)

Batch processing

Process multiple images:

python scripts/image_processor.py ./images/*.jpg --output-dir ./output --mode frame --text "配文"

Font configuration

The script searches for Chinese fonts in the following order:

  1. C:/Windows/Fonts/msyh.ttc - Microsoft YaHei
  2. C:/Windows/Fonts/simhei.ttf - SimHei
  3. C:/Windows/Fonts/simsun.ttc - SimSun
  4. System default font (may not support Chinese)

To use a custom font:

python scripts/image_processor.py input.jpg output.jpg --font "C:/MyFonts/custom.ttf" --text "配文"

Color reference

Common color values:

Name Code Purpose
White white / #FFFFFF Border background
Black black / #000000 Dark background/text
Light orange #FFE4B5 Sticker background
Light blue #E3F2FD Sticker background
Light green #E8F5E9 Sticker background
Light pink #FCE4EC Sticker background

Cooperating with other Skills

  1. Use Image Search Skill to find suitable images
  2. Use this Skill to add captions
  3. In General Writing Skill reference the processed images

Notes

  1. Image formats: Supports common formats such as JPG, PNG, WEBP, etc.
  2. Output format: Automatically select the format based on the output file extension
  3. Emoji rendering: requires installing the pilmoji library
  4. Font permissions: ensure read permission for the font file