compress-images

compress-images is a command for Claude Code from danielrosehill/Claude-Image-Production-Plugin. It costs 0 tokens per session (1,771 once invoked), scanned B, original, MIT.

A command for reducing image file sizes while keeping an acceptable level of visual quality. It can optimise files, change formats, and optionally resize images.

In plain words
What is it for?
Use it to prepare images for websites, convert them to formats such as WebP or AVIF, optimise JPEGs, or process a group of images.
Why use it?
Large images load slowly and use more storage or bandwidth. This command helps compare the original and compressed files so the size reduction is clear.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: positional $N argument.

Part of the image-production plugin — 29 skills, 19 commands shipped together

Good fit Use it to prepare images for websites, convert them to formats such as WebP or AVIF, optimise JPEGs, or process a group of images.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/danielrosehill/claude-image-production-plugin/compress-images
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.

Clone the repo
git clone --depth 1 https://github.com/danielrosehill/Claude-Image-Production-Plugin

Made for: Claude Code.

Or install image-production, the plugin that ships this one along with the rest of its 29 skills, 19 commands.

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 compress-images

README.md
[![agentmods](https://agentmods.dev/badge/commands/danielrosehill/claude-image-production-plugin/compress-images/github.svg)](https://agentmods.dev/commands/danielrosehill/claude-image-production-plugin/compress-images)
Your own site
<a href="https://agentmods.dev/commands/danielrosehill/claude-image-production-plugin/compress-images"><img src="https://agentmods.dev/badge/commands/danielrosehill/claude-image-production-plugin/compress-images/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 compress-images

Your own site · 80×15
<a href="https://agentmods.dev/commands/danielrosehill/claude-image-production-plugin/compress-images"><img src="https://agentmods.dev/badge/commands/danielrosehill/claude-image-production-plugin/compress-images.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,771 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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.00000 $0.01771
Opus 5 $0.00000 $0.00886
Sonnet 5 $0.00000 $0.00354
Haiku 4.5 $0.00000 $0.00177

Measured 9d ago against content hash 68c64221f272, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade B, and why

compress-images scanned grade B with 1 finding 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 9d 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.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

sudo apt install jpegoptim
commands/compress-images.md · 291 lines

How it starts

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

Compress Images

You are a photo editing assistant specialized in optimizing and compressing images to reduce file size while maintaining acceptable quality.

Your Task

Help the user compress images efficiently:

  1. Ask the user for:

    • Input image(s) or directory
    • Target compression level or file size
    • Whether to convert format (JPEG, WebP, AVIF)
    • Whether to resize during compression
    • Output quality preference
  2. Choose compression method:

    • Lossy compression (JPEG, WebP) - smaller files, some quality loss
    • Lossless optimization - remove metadata, optimize encoding
    • Format conversion - modern formats (WebP, AVIF) for better compression
    • Progressive/responsive - optimize for web delivery
  3. Execute and report:

    • Original vs compressed file sizes
    • Compression ratio achieved
    • Quality metrics if needed

JPEG Compression

ImageMagick

High quality (minimal compression):

convert input.jpg -quality 95 output.jpg

Balanced quality/size:

convert input.jpg -quality 85 output.jpg

Web optimized:

convert input.jpg -quality 75 -strip output.jpg

Aggressive compression:

convert input.jpg -quality 60 -strip output.jpg

Progressive JPEG (better for web):

convert input.jpg -quality 85 -interlace Plane -strip output.jpg

jpegoptim (Lossless Optimization)

Install jpegoptim if needed:

sudo apt install jpegoptim

Lossless optimization:

jpegoptim --strip-all input.jpg

Target maximum quality:

jpegoptim --max=85 --strip-all input.jpg

Target file size (e.g., 200KB):

jpegoptim --size=200k input.jpg

PNG Compression

optipng

Install optipng:

sudo apt install optipng

Optimize PNG (lossless):

optipng -o7 input.png

Faster optimization:

optipng -o2 input.png

pngquant (Lossy but High Quality)

Install pngquant:

sudo apt install pngquant

Read the full file on GitHub · 291 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. 9d ago First seen · 291 lines · 0 tokens per session scan B 68c64221f272

Subscribe to this mod's changes

compress-images is a command published in the GitHub repository danielrosehill/Claude-Image-Production-Plugin (16 stars, last pushed 23d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,771 tokens. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.