A Claude Code skill that analyzes image files to extract dimensions, format, and metadata.
The skill is now installed in your ~/.claude/skills/image-info/ directory.
The skill requires Python 3 and the Pillow library. The skill automatically creates a virtual environment in ~/.claude/skills/image-info/venv and installs Pillow there on first use.
To manually set up the virtual environment:
python3 -m venv ~/.claude/skills/image-info/venv
~/.claude/skills/image-info/venv/bin/pip install PillowYou can invoke this skill in two ways:
/image-info path/to/image.jpg
Just ask Claude naturally:
- "Analyze this image: path/to/image.png"
- "Get image info for screenshot.jpg"
- "Show me the metadata for photo.jpeg"
- "What are the dimensions of banner.png?"
The skill extracts and displays:
- Dimensions: Width and height in pixels
- Format: Image format (PNG, JPEG, GIF, etc.)
- Color Mode: RGB, RGBA, L (grayscale), etc.
- File Size: Human-readable file size
- Additional Properties: Format-specific metadata
- EXIF Metadata: Camera info, GPS data, timestamps, etc. (if available)
- Animation Info: Frame count and duration for GIFs
All formats supported by Pillow:
- PNG
- JPEG/JPG
- GIF (including animated)
- BMP
- TIFF
- WebP
- ICO
- PPM, PGM, PBM
- And many more
/image-info ~/Pictures/vacation.jpg
Output:
============================================================
IMAGE ANALYSIS: vacation.jpg
============================================================
Dimensions: 4032 x 3024 pixels
Format: JPEG
Mode: RGB
File Size: 2.45 MB
EXIF Metadata:
------------------------------------------------------------
Make: Apple
Model: iPhone 12 Pro
DateTime: 2024:08:15 14:23:10
Software: iOS 17.5.1
...
/image-info logo.png
Output shows alpha channel info and no EXIF data (PNGs typically don't have EXIF).
/image-info animation.gif
Output includes frame count and duration information.
SKILL.md- Skill definition and instructions for Claudeanalyze_image.py- Python script that performs the analysisREADME.md- This documentation file
"Pillow library not installed"
- The skill should automatically create a venv and install Pillow
- If it fails, manually run:
~/.claude/skills/image-info/venv/bin/pip install Pillow
"File not found"
- Check the path is correct
- Use absolute paths or paths relative to your current directory
"Error analyzing image"
- The file might be corrupted
- The file might not be a valid image format
Recreating the virtual environment
- If you need to start fresh, delete the venv directory:
rm -rf ~/.claude/skills/image-info/venv - The skill will recreate it on next use