home / skills / aidotnet / moyucode / image-processor

image-processor skill

/skills/tools/image-processor

This skill helps you resize, convert, watermark, and generate thumbnails for images using simple commands.

npx playbooks add skill aidotnet/moyucode --skill image-processor

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
1.1 KB
---
name: image-processor
description: 处理图片 - 调整大小、转换格式、添加水印、生成缩略图。基于Pillow。
metadata:
  short-description: 调整大小、转换和处理图片
source:
  repository: https://github.com/python-pillow/Pillow
  license: HPND
---

# Image Processor Tool

## Description
Process images with resize, format conversion, watermarks, and thumbnail generation.

## Trigger
- `/process-image` command
- User requests image manipulation
- User needs to resize or convert images

## Usage

```bash
# Resize image
python scripts/process_image.py resize --input photo.jpg --output resized.jpg --width 800

# Convert format
python scripts/process_image.py convert --input photo.png --output photo.webp

# Add watermark
python scripts/process_image.py watermark --input photo.jpg --output marked.jpg --text "© 2024"

# Generate thumbnails
python scripts/process_image.py thumbnail --input photo.jpg --sizes 64,128,256
```

## Tags
`image`, `resize`, `convert`, `thumbnail`, `watermark`

## Compatibility
- Codex: ✅
- Claude Code: ✅

Overview

This skill processes images with common tasks like resizing, format conversion, watermarking, and thumbnail generation. It uses a Pillow-based backend and exposes commands to transform single images or produce multiple outputs. The tool is designed for quick, scriptable image workflows in CI pipelines or local processing tasks.

How this skill works

You call the provided commands to perform an operation (resize, convert, watermark, thumbnail) against an input image and write the result to an output path. The tool accepts parameters for dimensions, output format, watermark text/position, and a list of thumbnail sizes. Under the hood it loads the image, applies the requested transformation using Pillow primitives, and saves the output with the chosen format and quality settings.

When to use it

  • Batch resizing photos for web galleries or responsive sites.
  • Converting images to web-friendly formats like WebP for smaller payloads.
  • Adding visible copyright or brand watermarks to assets before distribution.
  • Generating multiple thumbnail sizes for CMS or app image feeds.
  • Automating image processing in build or deployment pipelines.

Best practices

  • Work on copies of originals; keep a master source to avoid quality loss from repeated edits.
  • Choose an output format that matches the use case (JPEG for photos, PNG for transparency, WebP for web performance).
  • Resize before converting when producing thumbnails to minimize memory and CPU.
  • Apply watermarks with adjustable opacity and placement to avoid obscuring important content.
  • Process images in batches and monitor memory usage for large files; prefer streaming or chunked operations where supported.

Example use cases

  • Resize a portrait folder to 800 px width for an online gallery.
  • Convert PNG assets to WebP to reduce page load size while preserving quality.
  • Overlay a © 2024 watermark on marketing images before publishing.
  • Generate 64, 128, and 256 px thumbnails for a CMS image upload endpoint.
  • Integrate the command into CI to produce optimized assets during deployment.

FAQ

Can the tool preserve image metadata (EXIF)?

By default it focuses on pixel transformations; preserving EXIF may require explicit options or additional handling depending on the command.

Will repeated resizing degrade image quality?

Yes. Always keep a high-resolution master and derive different sizes from it to avoid cumulative quality loss.