img-convert

img-convert is a skill for Claude Code, Codex from dutchbase/img-converter. It costs 96 tokens per session (4,551 once invoked), scanned A, original, MIT.

Instructions for using img-convert, a tool for inspecting and processing images through a command line, Node.js, or an MCP connection. It supports common format, size, rotation, color, and metadata operations.

In plain words
What is it for?
Converting, resizing, rotating, optimizing, inspecting, and batch-processing images in scripts, applications, or agent workflows.
Why use it?
It helps choose the right image-processing interface and inspect files before making conversions that could affect quality or metadata.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: reads .claude/ paths; mentions Claude Code.

Good fit Converting, resizing, rotating, optimizing, inspecting, and batch-processing images in scripts, applications, or agent workflows.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/dutchbase/img-converter/img-converter
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add dutchbase/img-converter --skill img-converter
Clone the repo
git clone --depth 1 https://github.com/dutchbase/img-converter

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for img-convert

README.md
[![agentmods](https://agentmods.dev/badge/skills/dutchbase/img-converter/img-converter/github.svg)](https://agentmods.dev/skills/dutchbase/img-converter/img-converter)
Your own site
<a href="https://agentmods.dev/skills/dutchbase/img-converter/img-converter"><img src="https://agentmods.dev/badge/skills/dutchbase/img-converter/img-converter/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for img-convert

Your own site · 80×15
<a href="https://agentmods.dev/skills/dutchbase/img-converter/img-converter"><img src="https://agentmods.dev/badge/skills/dutchbase/img-converter/img-converter.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 96 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,551 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00096 $0.04551
Opus 5.5 $0.00038 $0.01820
Sonnet 5.5 $0.00019 $0.00910
Haiku 4.5 $0.00010 $0.00455

Measured 1mo ago against content hash 69334499677d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

img-convert scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

SKILL.md · 261 lines

How it starts

The opening of the file, as written. The whole thing — 261 lines — stays where its author put it; the contents beside it link to each section on GitHub.

img-convert

Sharp-based image converter. This guide covers v2 of the CLI (img-convert --version prints 2.x). Prefer the CLI; the MCP server and Node API are covered briefly at the end.

Rules for agents

  1. Always pass --json and parse stdout. Progress and warnings go to stderr.
  2. Parse stdout even when the exit code is 1. Exit 1 means some items failed; the JSON array still lists every item. Check each item's ok.
  3. Exit 2 means the command itself was wrong (bad flag, unknown format, no matching files, bad manifest). With --json, stdout is {"error":{"code","message"}}. Fix the command; don't retry it unchanged.
  4. Read the output path from the JSON. Don't predict it: filenames are sanitized (my photo.jpg → my_photo.webp).
  5. Quote glob patterns ("imgs/*.png", "imgs/**/*.png" where ** recurses into subfolders, "*.{jpg,png}") so the CLI expands them, not the shell. Prefer absolute paths.
  6. Run img-convert info first on images you know nothing about (alpha, animation, size).
  7. For different settings per file, use a batch manifest (img-convert batch - --json reads it from stdin) instead of a shell loop.
  8. No in-place edits: writing to the input's own path is refused (OUTPUT_IS_INPUT). Write to another directory with -o, then move the file if needed.
  9. Metadata (including GPS) is kept by default. Pass --no-metadata to strip it.

Recipes

# Convert one file (output goes next to the input: photo.webp)
img-convert /abs/photo.jpg -f webp --json

# Web-optimize a folder into another folder
img-convert "/abs/site/img/*.{jpg,png}" -f webp -q 80 --no-metadata -o /abs/site/img-webp --json

# Exact-size square thumbnail (crops to fill)
img-convert /abs/photo.jpg -f webp --width 200 --height 200 --fit cover -o /abs/thumbs --json

# Fit inside a box, keep aspect ratio (default --fit inside; never enlarges)
img-convert /abs/banner.png -f jpeg --width 1280 --height 720 --json

# Stay under an upload limit (highest quality that fits; jpeg/webp/avif only)
img-convert /abs/photo.png -f jpeg --max-size 200KB --json

# Strip EXIF/GPS but keep the format: write elsewhere, then move.
# This re-encodes the image, so use a high -q to avoid visible quality loss.
img-convert /abs/photo.jpg -f jpeg -q 95 --no-metadata -o /abs/clean --json && mv /abs/clean/photo.jpg /abs/photo.jpg

# iPhone HEIC → JPEG (HEIC must be a local .heic/.heif file or stdin)
img-convert /abs/IMG_0001.HEIC -f jpeg --json

# Transparent PNG → JPEG (transparency becomes white; choose another fill with --background)
img-convert /abs/logo.png -f jpeg --background "#000000" --json

# Crop a region (left,top,width,height in pixels of the upright source), then resize
img-convert /abs/shot.png -f png --crop 100,50,800,600 --width 400 -o /abs/out --json

# Keep animation (GIF/WebP → GIF/WebP only)
img-convert /abs/anim.gif -f webp --json

# From a URL (saved in the current directory unless -o is given)
img-convert https://example.com/pic.png -f avif -o /abs/downloads --json

# Pipe: stdin → stdout (no JSON; errors on stderr, exit 1)
cat in.png | img-convert -f webp > out.webp

# Inspect a folder
img-convert info "/abs/imgs/*"

# Whole tree, recursively (quote the glob)
img-convert "/abs/imgs/**/*.png" -f webp -o /abs/out --json

# Same filenames in different folders (a/x.png, b/x.png) would collide in one -o dir
# (DUPLICATE_OUTPUT). Keep them apart by giving each item its own outputDir:
find /abs/imgs -name '*.png' | jq -R '{input: ., format: "webp", outputDir: ("/abs/out" + (. | ltrimstr("/abs/imgs") | sub("/[^/]*$"; "")))}' \
  | jq -s . | img-convert batch - --json

# Preview a big job without writing anything
img-convert "/abs/imgs/**/*.png" -f avif -o /abs/out --dry-run --json

# Different settings per file
echo '[{"input":"/abs/a.png","format":"webp","width":800},{"input":"/abs/b.png","format":"jpeg","maxSize":"100KB"}]' \
  | img-convert batch - --json

Read the full file on GitHub · 261 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed · -271 lines · +23 tokens per session 69334499677d
  2. 1mo ago First seen · 532 lines · 73 tokens per session scan A f5ac1c0bb007

Subscribe to this mod's changes

img-convert is a skill published in the GitHub repository dutchbase/img-converter (3 stars, last pushed 19d ago), licensed MIT. It adds 96 tokens to every session and 4,551 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.