Image Handler
by @neckr0ik
Read, analyze metadata, convert formats, resize, rotate, crop, compress, and batch process PNG, JPG, GIF, WebP, TIFF, BMP, HEIC, SVG, and ICO images.
clawhub install image-handlerπ About This Skill
name: image-handler description: 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.
Image Handler
Analyze, convert, and manipulate image files.
Supported Formats
| Format | Extensions | Read | Convert | Metadata | |--------|------------|------|---------|----------| | PNG | .png | β | β | β | | JPEG | .jpg, .jpeg | β | β | β | | GIF | .gif | β | β | β | | WebP | .webp | β | β | β | | TIFF | .tiff, .tif | β | β | β | | BMP | .bmp | β | β | β | | HEIC | .heic, .heif | β | β | β | | SVG | .svg | β | β | - | | ICO | .ico | β | β | β |
Quick Commands
Metadata (sips - built-in macOS)
# Get all properties
sips -g all image.jpgGet specific properties
sips -g pixelWidth -g pixelHeight -g format -g dpiWidth -g dpiHeight image.jpgJSON-like output (parseable)
sips -g all image.jpg 2>&1 | tail +2
Convert Formats
# Convert to PNG
sips -s format png input.jpg --out output.pngConvert to JPEG with quality
sips -s format jpeg -s formatOptions 85 input.png --out output.jpgConvert HEIC to JPEG
sips -s format jpeg input.heic --out output.jpgBatch convert (shell)
for f in *.heic; do sips -s format jpeg "$f" --out "${f%.heic}.jpg"; done
Resize
# Resize to max dimensions (maintains aspect ratio)
sips --resampleWidth 1920 image.jpg --out resized.jpg
sips --resampleHeight 1080 image.jpg --out resized.jpgResize to exact dimensions
sips --resampleWidth 1920 --resampleHeight 1080 image.jpg --out resized.jpgScale by percentage
sips --resampleWidth 50% image.jpg --out half.jpg
Rotate & Flip
# Rotate 90 degrees clockwise
sips --rotate 90 image.jpg --out rotated.jpgRotate 180 degrees
sips --rotate 180 image.jpg --out rotated.jpgFlip horizontal
sips --flip horizontal image.jpg --out flipped.jpgFlip vertical
sips --flip vertical image.jpg --out flipped.jpg
Crop
# Crop to specific pixels (x, y, width, height)
sips --cropToHeightWidth 500 500 image.jpg --out cropped.jpgCrop from center
sips --cropToHeightWidth 500 500 --cropOffset 100 100 image.jpg --out cropped.jpg
Strip Metadata
# Remove EXIF and all metadata
sips --deleteProperty all image.jpg --out clean.jpg
ffmpeg (advanced operations)
# WebP to PNG
ffmpeg -i input.webp output.pngExtract frames from GIF
ffmpeg -i animation.gif frame_%03d.pngCreate GIF from images
ffmpeg -framerate 10 -i frame_%03d.png output.gifResize with ffmpeg
ffmpeg -i input.jpg -vf scale=1920:-1 output.jpgConvert video to GIF
ffmpeg -i video.mp4 -vf "fps=10,scale=480:-1" output.gif
Scripts
image_info.sh
Get comprehensive image metadata.
~/Dropbox/jarvis/skills/image-handler/scripts/image_info.sh
convert_image.sh
Convert between formats with options.
~/Dropbox/jarvis/skills/image-handler/scripts/convert_image.sh batch_convert.sh
Convert all images in a directory.
~/Dropbox/jarvis/skills/image-handler/scripts/batch_convert.sh [output_dir]
Workflow
1. Get info β sips -g all for dimensions, format, metadata
2. Convert if needed β Change format for compatibility
3. Resize/optimize β Reduce file size for web/sharing
4. Strip metadata β Remove EXIF for privacy
Notes
sips is built into macOS β no installation neededffmpeg handles WebP, animated GIFs, and video-to-imagecat or text toolsπ Tips & Best Practices
sips is built into macOS β no installation neededffmpeg handles WebP, animated GIFs, and video-to-imagecat or text tools