Back to list
leobrival

image-processing

by leobrival

Serum plugin for Claude Code

0🍴 0📅 Jan 20, 2026

SKILL.md


name: image-processing description: Smart image processing for resize, compress, and convert operations with batch support. Use when users ask to resize images, compress photos, convert to WebP/AVIF, batch process images, optimize for social media, or create image thumbnails. Supports modern formats and aspect ratios.

Image Processing

Smart image processor with automatic single-file and batch operation detection, modern format support, and social media presets.

Quick Start

Process images with optimal defaults:

cd ~/.claude/scripts/media-tools
bun run image photo.jpg --Format webp --Quality 85

Intelligent Behavior

Automatically detects input type and adjusts processing:

InputBehavior
Single file (photo.jpg)Process that file
Directory (./photos/)Process all images in directory
Glob pattern (*.png)Process matching files
Multiple filesProcess each file

CLI Options

OptionDefaultOptionsDescription
Resolutionoriginaloriginal, 3840, 2560, 1920, 1280, 800, 640, customTarget width in pixels
Ratiooriginaloriginal, 16:9, 9:16, 3:2, 1:1, 4:5, 4:3, 21:9Aspect ratio (crops to fit)
Formatwebporiginal, webp, jpg, png, avifOutput format
Quality8595, 85, 75, 65, 55, 45Quality level (1-100)
Outputsamesame, subfolder, customOutput location

Features

Format Support:

  • WebP - Best compression/quality ratio (recommended)
  • AVIF - Next-gen format, excellent compression
  • JPG - Universal compatibility
  • PNG - Lossless, supports transparency

Smart Processing:

  • Preserves original files (creates new output)
  • Strips metadata for smaller files
  • Maintains aspect ratio or crops to specified ratio
  • Handles batch operations efficiently

Supported Input Formats: jpg, jpeg, png, gif, webp, tiff, avif, bmp, heic

Usage Examples

Single file - resize and convert

bun run image photo.jpg --Resolution 1920 --Ratio 16:9 --Format webp

Single file - compress only

bun run image photo.jpg --Format webp --Quality 75

Batch - entire folder

bun run image ./photos/ --Resolution 1280 --Format webp --Output subfolder

Shows preview before processing:

Found 24 images to process:
- photo1.jpg (2.4 MB)
- photo2.png (1.8 MB)
- ... and 22 more

Settings:
- Resolution: 1280 (original → 1280px width)
- Ratio: original (keep aspect ratio)
- Format: webp
- Quality: 85%
- Output: ./photos/processed/

Proceed? [Yes/No]

Batch - specific files

bun run image "*.png" --Format webp --Quality 85

Instagram post (1:1 ratio)

bun run image ./uploads/ --Resolution 1280 --Ratio 1:1 --Format jpg

Instagram story (9:16 ratio)

bun run image ./content/ --Resolution 1080 --Ratio 9:16 --Format jpg --Quality 90

Social Media Presets

PlatformResolutionRatioFormatQualityUse Case
Web hero192016:9webp85Hero images
Thumbnail64016:9webp75Grid thumbnails
Instagram post12801:1jpg85Feed posts
Instagram story10809:16jpg85Stories/Reels
Twitter/X128016:9jpg85Tweets with images
LinkedIn19201.91:1jpg85Posts
OG image12001.91:1jpg85Social sharing
4K wallpaper384016:9png95Desktop backgrounds

Processing Modes

With resize and crop (when ratio specified)

magick input.jpg \
  -resize 1920x1080^ \
  -gravity center \
  -extent 1920x1080 \
  -quality 85 \
  -strip \
  output.webp

Compress only (original dimensions)

magick input.jpg \
  -quality 85 \
  -strip \
  output.webp

Resize without crop (original ratio)

magick input.jpg \
  -resize 1920x \
  -quality 85 \
  -strip \
  output.webp

Aspect Ratio Calculations

When a ratio is specified, height is calculated automatically:

RatioCalculationExample (width=1920)
16:9height = width × 9/161080px
9:16height = width × 16/93413px
3:2height = width × 2/31280px
1:1height = width1920px
4:5height = width × 5/42400px
4:3height = width × 3/41440px
21:9height = width × 9/21823px

Processing Results

After batch processing, shows detailed report:

✓ Processed 24 images

Summary:
- Total input:  45.2 MB
- Total output: 12.8 MB
- Compression:  72% smaller
- Time:         1.2s

Output: ./processed/

Best Practices

  1. Use WebP for web - 30% smaller than JPG with same quality
  2. Keep originals - Tool never modifies source files
  3. Quality 85 - Sweet spot for most use cases
  4. Add dimensions - Prevent layout shifts on web
  5. Test compression - Start with Quality 85, adjust if needed
  6. Batch wisely - Process similar images together
  7. Use ratios for social - Consistent sizing across platforms

Requirements

  • ImageMagick 7+ - Uses magick command
  • Install: brew install imagemagick
  • Command: plugins/media-tools/commands/image.md
  • Media Processor: plugins/media-tools/skills/media-processor/
  • Video Processing: plugins/media-tools/skills/video-processing/

Score

Total Score

60/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon