Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

img2pdf

$ img2pdf Community Low Risk
Johannes Schauer · AI & Media · LGPL-3.0-or-later · macos / linux / windows

img2pdf embeds raster images directly into PDF containers without lossy JPEG recompression or unnecessary pixel decoding. Unlike ImageMagick PDF conversion, it preserves exact bytes, DPI, and EXIF orientation while supporting deterministic --output - stdout pipelines.

FCRS-1.0 Score
82 /100
Good
Medium Confidence
Zero-Friction Install
brew install img2pdf
CLI vs MCP Decision CLI Only

Zero-recompression image-to-PDF packaging is fast, deterministic, and strictly local.

Agent-Readiness Checklist

— JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
✓ NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 18 / 25

Clean non-interactive Python CLI with standard GNU flags, -o output path, and predictable non-zero errors on unsupported alpha channels, though no JSON or --dry-run.

  • Non-interactive argparse CLI with clear error messages
  • Lacks JSON output and --dry-run
Trust & Safety 22 / 25

Never modifies source images and supports --nodate for reproducible deterministic PDF hashes.

  • Input image files remain untouched
  • Supports deterministic output with --nodate
Setup & Portability 13 / 15

Available via brew install img2pdf, pip install img2pdf, and uvx img2pdf across macOS, Linux, and Windows.

  • Distributed via Homebrew, PyPI, and Linux package managers
Utility & Efficiency 13 / 15

Avoids the massive bloat and quality loss caused by ImageMagick's raster-to-PDF conversion.

  • Embeds JPEG streams losslessly without decode/re-encode
Maintenance & Lineage 8 / 10

Long-maintained Debian-origin project by Johannes Schauer with stable releases.

  • Maintained on gitlab.mister-muffin.de/josch/img2pdf
Docs & Verifiability 8 / 10

Concise --help and README documenting page sizes (A4, Letter), borders, and alpha-channel behavior.

  • Standard --help covers all layout and rotation flags

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

None required; operates purely on local image files or stdin.

Side Effects
Read-Only Local Write
Cost & Quotas

Free LGPL-3.0-or-later open-source Python CLI.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# img2pdf Agent Rules
- Strip alpha channels from PNGs (or convert via `vips`/`magick`) first if `img2pdf` rejects transparency.
- Specify `-o <output.pdf>` explicitly so binary PDF bytes are not dumped to the terminal.

Agent-Ready Command Recipes

Safe Read-Only Queries

Check img2pdf version and supported options
img2pdf --help

Displays page-size, layout, and rotation options without reading or writing assets.

Controlled Writes & Previews

Bundle ordered JPEGs into an A4 PDF
img2pdf --pagesize A4 page1.jpg page2.jpg -o bundle.pdf

Wraps page1.jpg and page2.jpg into bundle.pdf with A4 page sizing and no JPEG recompression.

Strengths for Agents

  • + True lossless wrapping of JPEGs into PDFs with minimal file size and zero quality degradation.
  • + Supports --nodate and --pagesize for reproducible, clean document generation.

Caveats & Pitfalls

  • ! Refuses PNGs with alpha channels by default unless flattened or passed with --pillow-limit-pixels workarounds.
  • ! Writing without -o outputs raw binary PDF bytes to stdout.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI