360 Secure SkillHub
360 安全技能中心

Image Processor

该 Skill 提供 Python 命令行脚本,用于处理图像:按尺寸或百分比缩放、裁剪、转换 JPG/PNG/WebP/GIF 格式、控制压缩质量、生成缩略图,以及灰度、模糊和旋转,并可通过 shell 循环进行批量处理。

dinghaibin
dinghaibin
热度 34.15
最近更新 2026-05-11 17:46:29
分类:效率依赖:代码执行 / 读写文件应用场景:文件转换 / 自动化脚本 / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add dinghaibin-image-processor
Metadata
name
image-processor
description
Process and convert images with resize, crop, compress, and format conversion. Use when user needs to batch resize photos, convert image formats, compress images for web, create thumbnails, or apply filters to images.

Image Processor

Process and convert images with resize, crop, compress, and format conversion.

Quick Start

# Resize an image
python scripts/process.py input.jpg --resize 800x600 --output output.jpg

# Convert format
python scripts/process.py input.png --format jpg --output output.jpg

Usage

python scripts/process.py INPUT [OPTIONS]

Options:
  --output PATH      Output file path
  --resize WxH       Resize to dimensions
  --scale PERCENT    Scale by percentage
  --crop WxH+X+Y     Crop to dimensions
  --format FORMAT    Convert format: jpg, png, webp, gif
  --quality QUALITY  JPEG quality (1-100)
  --thumbnail SIZE  Create thumbnail
  --grayscale        Convert to grayscale
  --blur RADIUS      Apply blur
  --rotate DEGREES   Rotate image

Examples

# Resize to 800px width
python scripts/process.py photo.jpg --resize 800x0 --output small.jpg

# Create thumbnail
python scripts/process.py photo.jpg --thumbnail 200x200 --output thumb.jpg

# Compress for web
python scripts/process.py large.jpg --quality 80 --format webp --output optimized.webp

# Batch resize
for f in *.jpg; do python scripts/process.py "$f" --resize 1200x0 --output "small_$f"; done

# Convert to PNG
python scripts/process.py input.jpg --format png --output output.png

Features

  • Resize (by dimensions or percentage)
  • Crop
  • Format conversion (JPG, PNG, WebP, GIF)
  • Quality/compression control
  • Thumbnails
  • Grayscale conversion
  • Blur filter
  • Rotation
  • Batch processing