| name | image-process |
| description | Resize, convert, compress, crop, annotate images and process video/audio. Use when working with image files or when output needs to be an image. |
| metadata | {"ccbot":{"emoji":"🖼️","requires":{"bins":["convert"]}}} |
Image Processing Skill
Uses ImageMagick (convert) and ffmpeg. Output images to output/ for Feishu delivery.
Setup Check
which convert && convert --version | head -1
which ffmpeg && ffmpeg -version 2>&1 | head -1
Install: brew install imagemagick ffmpeg / apt install imagemagick ffmpeg
Resize & Convert
convert input.png -resize 1200x1200\> output/resized.jpg
convert input.heic output/photo.jpg
convert input.pdf[0] output/page1.png
convert input.jpg -quality 80 output/compressed.jpg
mkdir -p output
for f in *.png; do
convert "$f" -resize 800x\> "output/${f%.png}.jpg"
done
Crop & Annotate
convert input.png -crop 400x300+100+50 +repage output/cropped.png
convert input.png \
-font Arial -pointsize 36 -fill "rgba(255,255,255,0.6)" \
-gravity SouthEast -annotate +20+20 "© ccbot 2026" \
output/watermarked.png
convert input.png -bordercolor white -border 20x20 output/bordered.png
Create Thumbnails
convert input1.jpg input2.jpg input3.jpg input4.jpg \
-geometry 400x300+4+4 -background white \
montage - output/grid.jpg
Screenshot (macOS)
screencapture -x output/screenshot.png
screencapture -i output/selection.png
screencapture -l $(osascript -e 'tell app "Safari" to id of window 1') output/safari.png
Video: Extract / Convert
ffmpeg -ss 5 -i video.mp4 -frames:v 1 output/frame.jpg
ffmpeg -ss 90 -to 165 -i input.mp4 -c copy output/clip.mp4
ffmpeg -i input.mov -c:v libx264 -crf 23 -c:a aac output/video.mp4
ffmpeg -i video.mp4 -vn -c:a mp3 -q:a 2 output/audio.mp3
ffmpeg -ss 10 -t 3 -i input.mp4 -vf "fps=15,scale=480:-1" output/clip.gif
Generate Simple Charts (Python fallback)
uv run --with matplotlib pillow python3 - <<'EOF'
import matplotlib.pyplot as plt, matplotlib.patches as mpatches
categories = ["Jan", "Feb", "Mar", "Apr"]
values = [120, 98, 145, 133]
fig, ax = plt.subplots(figsize=(8, 5))
bars = ax.bar(categories, values, color=["#4A90D9", "#7B68EE", "#48C9B0", "#F39C12"])
ax.set_title("Monthly Data", fontsize=14, fontweight="bold")
ax.set_ylabel("Value")
for bar, val in zip(bars, values):
ax.text(bar.get_x() + bar.get_width()/2, bar.get_height() + 2, str(val),
ha="center", fontsize=10)
plt.tight_layout()
plt.savefig("output/chart.png", dpi=150)
print("Saved: output/chart.png")
EOF
Tips
- Always output to
output/ — ccbot auto-delivers via Feishu.
- Use
\> in ImageMagick resize to only shrink (never upscale).
- For HEIC photos (iPhone), install
heif-convert: brew install libheif.
- Large batches: run in parallel with
xargs -P 4.