返回顶部
i

image-handler图像处理

Read, analyze, convert, and manipulate image files (PNG, JPG, GIF, WebP, TIFF, BMP, HEIC, SVG, ICO). Use when working with images: reading metadata, converting formats, resizing, rotating, compressing, or batch processing. Triggers on mentions of image files, file paths with image extensions, or requests to process/convert images.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
1,060
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

image-handler

图像处理器

分析、转换和操作图像文件。

支持的格式

格式扩展名读取转换元数据
PNG.png
JPEG
.jpg, .jpeg | ✅ | ✅ | ✅ | | GIF | .gif | ✅ | ✅ | ✅ | | WebP | .webp | ✅ | ✅ | ✅ | | TIFF | .tiff, .tif | ✅ | ✅ | ✅ | | BMP | .bmp | ✅ | ✅ | ✅ | | HEIC | .heic, .heif | ✅ | ✅ | ✅ | | SVG | .svg | ✅ | ✅ | - | | ICO | .ico | ✅ | ✅ | ✅ |

快速命令

元数据(sips - macOS 内置)

bash

获取所有属性


sips -g all image.jpg

获取特定属性

sips -g pixelWidth -g pixelHeight -g format -g dpiWidth -g dpiHeight image.jpg

类 JSON 输出(可解析)

sips -g all image.jpg 2>&1 | tail +2

格式转换

bash

转换为 PNG


sips -s format png input.jpg --out output.png

转换为 JPEG 并设置质量

sips -s format jpeg -s formatOptions 85 input.png --out output.jpg

将 HEIC 转换为 JPEG

sips -s format jpeg input.heic --out output.jpg

批量转换(shell)

for f in *.heic; do sips -s format jpeg $f --out ${f%.heic}.jpg; done

调整大小

bash

按最大尺寸调整(保持宽高比)


sips --resampleWidth 1920 image.jpg --out resized.jpg
sips --resampleHeight 1080 image.jpg --out resized.jpg

按精确尺寸调整

sips --resampleWidth 1920 --resampleHeight 1080 image.jpg --out resized.jpg

按百分比缩放

sips --resampleWidth 50% image.jpg --out half.jpg

旋转与翻转

bash

顺时针旋转 90 度


sips --rotate 90 image.jpg --out rotated.jpg

旋转 180 度

sips --rotate 180 image.jpg --out rotated.jpg

水平翻转

sips --flip horizontal image.jpg --out flipped.jpg

垂直翻转

sips --flip vertical image.jpg --out flipped.jpg

裁剪

bash

按指定像素裁剪(x, y, 宽度, 高度)


sips --cropToHeightWidth 500 500 image.jpg --out cropped.jpg

从中心裁剪

sips --cropToHeightWidth 500 500 --cropOffset 100 100 image.jpg --out cropped.jpg

剥离元数据

bash

移除 EXIF 和所有元数据


sips --deleteProperty all image.jpg --out clean.jpg

ffmpeg(高级操作)

bash

WebP 转 PNG


ffmpeg -i input.webp output.png

从 GIF 提取帧

ffmpeg -i animation.gif frame_%03d.png

从图片创建 GIF

ffmpeg -framerate 10 -i frame_%03d.png output.gif

使用 ffmpeg 调整大小

ffmpeg -i input.jpg -vf scale=1920:-1 output.jpg

视频转 GIF

ffmpeg -i video.mp4 -vf fps=10,scale=480:-1 output.gif

脚本

image_info.sh

获取全面的图像元数据。

bash
~/Dropbox/jarvis/skills/image-handler/scripts/image_info.sh

convert_image.sh

在格式间转换并附带选项。

bash
~/Dropbox/jarvis/skills/image-handler/scripts/convert_image.sh [quality]

batch_convert.sh

转换目录中的所有图像。

bash
~/Dropbox/jarvis/skills/image-handler/scripts/batchconvert.sh dir> format> [outputdir]

工作流程

  1. 1. 获取信息 — sips -g all 获取尺寸、格式、元数据
  2. 按需转换 — 更改格式以确保兼容性
  3. 调整/优化 — 减小文件大小以便于网页/分享
  4. 剥离元数据 — 移除 EXIF 以保护隐私

备注

  • - sips 内置于 macOS — 无需安装
  • ffmpeg 处理 WebP、动画 GIF 和视频转图像
  • 对于 HEIC(iPhone 照片),转换为 JPEG 以确保兼容性
  • SVG 基于文本 — 使用 cat 或文本工具
  • 如需对图像进行 OCR,请使用文档处理器技能

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 image-handler-1776196781 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 image-handler-1776196781 技能

通过命令行安装

skillhub install image-handler-1776196781

下载

⬇ 下载 image-handler v1.0.0(免费)

文件大小: 4.16 KB | 发布时间: 2026-4-15 12:20

v1.0.0 最新 2026-4-15 12:20
Initial release - analyze, convert, resize images (PNG, JPG, GIF, WebP, HEIC, SVG, TIFF, BMP)

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部