Image Processing

Use when Pillow is needed for web-image resize, crop, trim, conversion, optimization, thumbnails, or OG cards.

anntnzrb Updated

File contents

Image Processing

Generate a task-specific Pillow script under <temp-dir>. This skill does not bundle a CLI.

uv run --with Pillow <temp-dir>/image-task.py

Safety

  • Inspect source dimensions, mode, format, and animation first
  • NEVER overwrite originals without explicit user intent
  • Write transformed files to explicit output paths
  • Preserve animation only when the requested format supports it
  • Test batch logic on one representative file first

Required follow-up reads

Need Read When
Pillow setup, format choice, and implementation patterns references/pillow-patterns.md Before writing the task-specific script

Workflow

  1. Resolve input and output paths with pathlib.Path
  2. Inspect images with Image.open() before transformation
  3. Select the smallest matching pattern from references/pillow-patterns.md
  4. Write a task-specific script under <temp-dir>
  5. Run it through the documented uv command
  6. Re-open outputs and verify dimensions, mode, and format

anntnzrb/agents/tree/main/skills/legacy/image-processing commit 5c0f18b37e

Frequently asked questions

npx skillmds@latest add anntnzrb/image-processing