AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified Apache-2.0 Self-run

Image Cropper

skill-hhhh124hhhh-skillmate-image-cropper · by hhhh124hhhh

图像裁剪工具,支持保持画面中心的智能裁剪。使用场景:(1)微信公众号封面裁剪(2.35:1)(2)社交媒体正方形裁剪(1:1)(3)批量处理图片尺寸(4)各种社交媒体预设尺寸(微信、微博、Instagram等)。当用户需要"裁剪图片"、"调整图片尺寸"、"生成正方形图片"、"微信封面裁剪"时触发此skill。

No reviews yet
0 installs
12 views
0.0% view→install

Install

$ agentstack add skill-hhhh124hhhh-skillmate-image-cropper

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-hhhh124hhhh-skillmate-image-cropper)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
6mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Image Cropper? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

图像裁剪工具

智能图像裁剪工具,支持保持画面中心的精准裁剪,专为社交媒体和内容创作优化。

🚀 快速开始

命令行使用

# 单张裁剪
python scripts/crop_image.py input.jpg --size 900x383 --output output.jpg

# 使用预设尺寸
python scripts/crop_image.py input.jpg --preset wechat-cover --output output.jpg

# 批量裁剪
python scripts/batch_crop.py folder/ --size 900x383 --output cropped_folder/

Python调用

from image_cropper.scripts.crop_image import crop_to_center

# 裁剪为指定尺寸
crop_to_center("input.jpg", "output.jpg", width=900, height=383)

# 使用预设尺寸
crop_to_center("input.jpg", "output.jpg", preset="wechat-cover")

# 批量裁剪
from image_cropper.scripts.batch_crop import batch_crop
batch_crop("folder/", "output_folder/", size="900x383")

📏 预设尺寸

微信公众号

  • wechat-cover: 900x383(2.35:1,公众号封面)
  • wechat-share: 900x900(1:1,分享卡片)
  • wechat-banner: 1080x460(2.35:1,高清封面)

社交媒体

  • instagram: 1080x1080(1:1,Instagram/微博)
  • twitter: 1200x675(16:9,Twitter横版)
  • linkedin: 1200x627(1.91:1,LinkedIn)

文章配图

  • article-16-9: 1792x1024(16:9,横版配图)
  • article-4-3: 1024x768(4:3,标准配图)
  • article-1-1: 1024x1024(1:1,正方形配图)

🎯 使用场景

场景1:微信公众号封面裁剪

需求:生成一张同时适合头条展示和朋友圈分享的封面

解决方案

# 生成2.35:1封面(900x383)
python scripts/crop_image.py original.jpg --preset wechat-cover --output cover.jpg

# 同时生成1:1测试版本(验证分享效果)
python scripts/crop_image.py original.jpg --preset wechat-share --output test_1to1.jpg

关键原则

  • 所有关键内容必须在中心60%区域
  • 确保裁剪为1:1后文字依然完整
  • 避免在边缘放置重要元素

场景2:批量处理配图

需求:将一个文件夹的所有图片统一裁剪为16:9

解决方案

python scripts/batch_crop.py raw_images/ --preset article-16-9 --output cropped_images/

场景3:Instagram正方形裁剪

需求:将横版照片裁剪为正方形

解决方案

python scripts/crop_image.py photo.jpg --preset instagram --output photo_square.jpg

🔧 参数说明

单张裁剪(crop_image.py)

| 参数 | 说明 | 示例 | |------|------|------| | input | 输入图片路径(必需) | photo.jpg | | --size | 输出尺寸(宽x高) | 900x383 | | --preset | 使用预设尺寸 | wechat-cover | | --output | 输出路径(必需) | output.jpg | | --quality | JPEG质量(1-100,默认95) | 95 |

注意--size--preset 二选一,优先使用 --preset

批量裁剪(batch_crop.py)

| 参数 | 说明 | 示例 | |------|------|------| | input_dir | 输入文件夹路径(必需) | images/ | | --size | 输出尺寸 | 900x383 | | --preset | 使用预设尺寸 | wechat-cover | | --output | 输出文件夹路径(必需) | cropped/ | | --pattern | 文件匹配模式(默认*.jpg) | *.png |

💡 最佳实践

1. 安全区域设计

对于可能被裁剪的场景(如微信封面),设计时遵循:

画面布局:
[边缘20%] [中心60%安全区] [边缘20%]

关键内容:只放在中心60%区域 装饰元素:可以放在边缘

2. 裁剪前测试

在正式使用前,先测试1:1裁剪效果:

# 生成多个测试版本
python scripts/crop_image.py original.jpg --size 900x900 --output test_1to1.jpg
python scripts/crop_image.py original.jpg --size 900x383 --output test_cover.jpg

检查:

  • ✅ 文字是否完整
  • ✅ 关键元素是否在中心
  • ✅ 裁剪后效果是否满意

3. 批量处理技巧

批量处理时,建议:

  • 先用1-2张图片测试效果
  • 确认满意后再批量处理
  • 保留原始文件备份

📊 依赖安装

pip install pillow

🛠️ 故障排查

常见问题

Q1:提示"PIL not available"

# 安装Pillow库
pip install pillow

Q2:裁剪后图片变形

原因:指定尺寸比例与原图不一致 解决:本工具保持原图比例中心裁剪,不会变形

Q3:裁剪位置不符合预期

原因:本工具默认保持画面中心裁剪 解决:如需自定义裁剪位置,可使用专业图像编辑工具

Q4:批量裁剪时某些图片失败

原因:图片格式不支持或文件损坏 解决:检查文件格式,支持JPG、PNG等常见格式

📚 参考资源

  • 预设尺寸列表references/preset-sizes.md
  • 使用示例:见上方各场景说明
  • 技术文档:Pillow官方文档 https://pillow.readthedocs.io/

最后更新:2026-01-11 Skill版本:v1.0 依赖:Pillow >= 8.0.0

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.