● 232 KB · zero dependencies · MIT

imgcli

A tiny, dependency-free command-line tool to convert, resize, crop, filter & composite images — an ffmpeg-style alternative to ImageMagick for still images, with agent-native JSON output.

232 KBsingle binary
0third-party deps
~8×faster vs ImageMagick*
29chainable filters
6formats in/out

Measurably faster & leaner

Real, reproducible numbers — run bench/bench.sh yourself. Mean time per invocation (lower is better), Apple Silicon, steady state.

Small PNG→JPEG + resize · one-shot
imgcli — 1.6 ms
ImageMagick — 4.7 ms
Resize 1200×1200 → 300w
imgcli — 6.0 ms
ImageMagick — 51.6 ms (8.6× slower)
Grayscale 1200×1200
imgcli — 48 ms
ImageMagick — 389 ms (8× slower)
MetricimgcliImageMagickAdvantage
Install footprint232 KB~109 MB~470× smaller
Third-party dependencies017 packagesnone to install
Resize 1200² → 300w6.0 ms51.6 ms8.6× faster
Grayscale 1200²48 ms389 ms8.0× faster

* Honest caveat: ImageMagick is a far broader toolkit (16-bit/HDRI precision, colour management, 200+ formats, advanced resampling). imgcli is a lean 8-bit RGBA pipeline — part of its speed is doing less, more directly. Full methodology & caveats: bench/RESULTS.md.

See it work

One binary, an ffmpeg-style filtergraph, every output below rendered by imgcli.

imgcli running in a terminal — convert, resize and filter images, with JSON output and a single zero-dependency binary
# resize keeping aspect, desaturate, soften — one pass
imgcli -i photo.jpg -vf "scale=1024:-1,grayscale,contrast=1.2,gblur=1.5" out.png

Why imgcli

Zero dependencies

A single self-contained binary that needs only libc. Nothing to apt install, no dependency tree, no version conflicts.

ffmpeg-style filtergraph

Chain operations: -vf "scale=800:-1,crop=400:400,sepia,gblur=2". 29 filters across geometry, colour, convolution and compositing.

Agent & script native

--json structured output, stable exit codes, fully non-interactive. Deterministic and token-economical for AI agents.

Secure by design

Audited against OWASP/CWE and ffmpeg's CVE classes. Dimension caps, overflow-safe allocation, hardened build, fuzzed, ASan/UBSan-clean. No network, no subprocesses.

Install

# Homebrew (macOS / Linux)
brew install swperb/tap/imgcli

# Arch Linux (AUR)
yay -S imgcli            # or: paru -S imgcli

# From source — only a C compiler + libm required
git clone https://github.com/swperb/imgcli && cd imgcli && make && sudo make install

Prebuilt Linux/macOS binaries on the releases page.

Use it from an AI agent (MCP)

imgcli ships an MCP server (imgcli-mcp on npm, listed in the official MCP registry) so agents call convert_image, probe_image and list_filters directly.

{
  "mcpServers": {
    "imgcli": { "command": "npx", "args": ["-y", "imgcli-mcp"] }
  }
}

imgcli vs the alternatives

imgcliImageMagickffmpeg
Install size232 KB~109 MB~80 MB
Dependencies017+many
Single static binaryyesnono
ffmpeg-style filtergraphyesnoyes
JSON output for agentsyesnopartial
MCP serveryesnono
Format breadth / precisionfocused (6)200+huge

Pick ImageMagick/ffmpeg for maximum format breadth and fidelity; pick imgcli when you want a tiny, fast, scriptable, agent-friendly convert/resize/filter tool with nothing to install.