image-downsize
Resize images to a specific resolution OR downsize to fit Claude API upload limits (max 1568px long edge, max 5MB). Use the exact-resize mode when the user…
от szprivate★ 53 звезды на GitHub
Установить image-downsize в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
When to use this skill
Only use this skill when the user explicitly asks to resize or downsize an image. Do NOT resize automatically.
Step-by-step:
- Call
get_image_resolutionto get the current width and height. - If the user gave a relative size ("half the size", "2×", "75%", etc.), use
calculatorto derive the exact target pixels from the current dimensions. - Run
downsize.pyviarun_scriptwith--width/--heightfor the resolved resolution.
Image Resize & Downsize
Two modes in one script:
| Mode | When to use | Key args |
|---|---|---|
| Exact resize | User asks for a specific resolution | --width and/or --height |
| Downsize | Preparing images for Claude API upload | --max-pixels / --multi |
Exact resize mode
Resize an image to a specific resolution. When only one dimension is given, the other is derived from the aspect ratio.
python {skill_path}/scripts/downsize.py <input_path> --width 1920 --height 1080 [--fit contain|cover|exact] [--output <output_path>]
--fit modes (default: contain):
contain— scale to fit inside the target box, preserving aspect ratio (no cropping)cover— scale to fill the target box, cropping the excess, preserving aspect ratioexact— stretch/squash to exactly the target size (may distort)
Examples:
# Resize to 1920x1080, letterboxed (no crop)
python {skill_path}/scripts/downsize.py photo.jpg --width 1920 --height 1080
# Resize to 1920x1080, cropping to fill
python {skill_path}/scripts/downsize.py photo.jpg --width 1920 --height 1080 --fit cover
# Resize width to 512px, height from aspect ratio
python {skill_path}/scripts/downsize.py photo.jpg --width 512
# Save to a new file
python {skill_path}/scripts/downsize.py photo.jpg --width 1024 --height 1024 --fit cover --output resized.jpg
Downsize mode (Claude API limits)
python {skill_path}/scripts/downsize.py <input_path> [--output <output_path>] [--max-pixels 1568] [--max-bytes 5242880] [--multi]
--max-pixels— long edge limit (default: 1568; the optimal quality threshold for Claude)--max-bytes— file size limit in bytes (default: 5 MB)--multi— shortcut for--max-pixels 2000(for batches of 20+ images)
Common arguments
input_path— single image or directory of images--output— output path (default: overwrites in place)--quality— JPEG/WebP quality 1-100 (default: 85)--max-bytes— enforced in both modes
Supported formats
JPEG, PNG, WebP, GIF
Output
{
"processed": 1,
"images": [{
"path": "/path/to/output.jpg",
"original": {"size": [3000, 2000], "bytes": 4200000},
"result": {"size": [1920, 1080], "bytes": 980000, "quality": 85, "fit": "contain"},
"resized": true
}]
}
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
- 01
run_script - 02
file_read
Вложенные файлы
- scripts/downsize.py
FAQ
Что делает скилл image-downsize?
Resize images to a specific resolution OR downsize to fit Claude API upload limits (max 1568px long edge, max 5MB). Use the exact-resize mode when the user requests a specific width/height; use downsize mode before sending images to Claude for analysis.
Как установить скилл image-downsize?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл image-downsize запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
skill-creator
AnthropicCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
discernment-nudge
AnthropicAfter you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
data-consolidate
AnthropicJoins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
inspection-to-capa
AnthropicRuns the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…