image-processing by jezweb/claude-skills
npx skills add https://github.com/jezweb/claude-skills --skill image-processing为网页开发处理图像。生成适应于用户环境和特定需求的 Pillow 脚本。
Pillow 通常已预装。如果没有:
pip install Pillow
如果 Pillow 不可用,请使用以下替代方案:
| 替代方案 | 平台 | 安装 | 功能 |
|---|---|---|---|
sips | macOS (内置) | 无 | 调整大小、转换格式 (无修剪/OG卡片) |
sharp | Node.js | npm install sharp | 完整功能集 |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
ffmpeg| 跨平台 |
brew install ffmpeg |
| 调整大小、转换格式 |
为以下任何操作生成使用 Pillow 的 Python 脚本。有关实现模式,请参阅 references/pillow-patterns.md,特别是 RGBA 转 JPG 合成和跨平台字体发现。
缩放到特定尺寸或按宽度/高度缩放(如果只指定一个维度,则保持宽高比)。使用 Image.LANCZOS 进行高质量缩小。
在 PNG、JPG、WebP 之间转换。通过合成到白色背景来处理 RGBA 转 JPG。应用特定格式的质量设置(WebP:85,JPG:90,PNG:优化)。
自动裁剪徽标和图标周围的空白区域。首先转换为 RGBA,然后使用 getbbox() 查找内容边界。
在保持宽高比的同时,适配最大尺寸。使用 img.thumbnail((size, size), Image.LANCZOS)。
一步完成调整大小和压缩。转换为 WebP 以获得最佳压缩效果。典型设置:宽度 1920,质量 85。
在背景图像或纯色上生成带有标题/副标题叠加的 Open Graph 卡片。应用半透明叠加层以提高文本可读性。水平居中文本。
调整最大宽度为 1920,转换为 WebP,以质量 85 进行压缩。
对于多个图像,生成一个循环处理所有文件的单一脚本,而不是一次处理一个。
使用 gemini-image-gen 技能生成图像,然后进行处理:
| 使用场景 | 格式 | 原因 |
|---|---|---|
| 照片、主图 | WebP | 最佳压缩效果,广泛的浏览器支持 |
| 徽标、图标(需要透明度) | PNG | 无损,支持 Alpha 通道 |
| 旧版浏览器回退 | JPG | 通用支持 |
| 缩略图 | WebP 或 JPG | 优先考虑小文件大小 |
| OG 卡片 | PNG | 社交平台对 PNG 处理效果最佳 |
| 何时 | 阅读 |
|---|---|
| 实现任何 Pillow 操作时 | references/pillow-patterns.md |
每周安装量
563
代码仓库
GitHub 星标数
643
首次出现
2026年2月27日
安全审计
安装于
opencode534
codex533
gemini-cli532
github-copilot532
kimi-cli531
amp531
Process images for web development. Generate a Pillow script adapted to the user's environment and specific needs.
Pillow is usually pre-installed. If not:
pip install Pillow
If Pillow is unavailable, adapt using alternatives:
| Alternative | Platform | Install | Capabilities |
|---|---|---|---|
sips | macOS (built-in) | None | Resize, convert (no trim/OG) |
sharp | Node.js | npm install sharp | Full feature set |
ffmpeg | Cross-platform | brew install ffmpeg | Resize, convert |
Generate a Python script using Pillow for any of these operations. See references/pillow-patterns.md for implementation patterns, especially RGBA-to-JPG compositing and cross-platform font discovery.
Scale to specific dimensions or by width/height (maintain aspect ratio if only one given). Use Image.LANCZOS for high-quality downscaling.
Convert between PNG, JPG, WebP. Handle RGBA-to-JPG by compositing onto white background. Apply format-specific quality settings (WebP: 85, JPG: 90, PNG: optimize).
Auto-crop surrounding whitespace from logos and icons. Convert to RGBA first, then use getbbox() to find content bounds.
Fit within max dimensions while maintaining aspect ratio. Use img.thumbnail((size, size), Image.LANCZOS).
Resize + compress in one step. Convert to WebP for best compression. Typical settings: width 1920, quality 85.
Generate Open Graph card with title/subtitle overlay on a background image or solid colour. Apply semi-transparent overlay for text readability. Centre text horizontally.
Resize to max width 1920, convert to WebP, compress at quality 85.
For multiple images, generate a single script that loops over all files rather than processing one at a time.
Generate images with the gemini-image-gen skill, then process them:
| Use case | Format | Why |
|---|---|---|
| Photos, hero images | WebP | Best compression, wide browser support |
| Logos, icons (need transparency) | PNG | Lossless, supports alpha |
| Fallback for older browsers | JPG | Universal support |
| Thumbnails | WebP or JPG | Small file size priority |
| OG cards | PNG | Social platforms handle PNG best |
| When | Read |
|---|---|
| Implementing any Pillow operation | references/pillow-patterns.md |
Weekly Installs
563
Repository
GitHub Stars
643
First Seen
Feb 27, 2026
Security Audits
Gen Agent Trust HubPassSocketWarnSnykPass
Installed on
opencode534
codex533
gemini-cli532
github-copilot532
kimi-cli531
amp531
agent-browser 浏览器自动化工具 - Vercel Labs 命令行网页操作与测试
136,300 周安装
HubSpot CRM 集成指南:使用 Membrane CLI 自动化销售、营销与客户服务
431 周安装
index-knowledge:自动生成层级化AGENTS.md文档工具,Turso数据库出品
431 周安装
产品问题陈述框架指南:如何用共情驱动方法定义用户问题 | 产品管理技能
432 周安装
机会解决方案树(OST)指南:产品经理结构化探索方法,避免功能工厂综合症
432 周安装
Obsidian Canvas 创建器:一键将文本转换为思维导图和视觉画布 | AI 驱动
432 周安装
make-pr:Remotion 项目自动化创建拉取请求工具,提升代码提交与协作效率
432 周安装