img2pdf
$ img2pdf Community Low Riskimg2pdf 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.
brew install img2pdf Zero-recompression image-to-PDF packaging is fast, deterministic, and strictly local.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
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
Never modifies source images and supports --nodate for reproducible deterministic PDF hashes.
- Input image files remain untouched
- Supports deterministic output with
--nodate
Available via brew install img2pdf, pip install img2pdf, and uvx img2pdf across macOS, Linux, and Windows.
- Distributed via Homebrew, PyPI, and Linux package managers
Avoids the massive bloat and quality loss caused by ImageMagick's raster-to-PDF conversion.
- Embeds JPEG streams losslessly without decode/re-encode
Long-maintained Debian-origin project by Johannes Schauer with stable releases.
- Maintained on
gitlab.mister-muffin.de/josch/img2pdf
Concise --help and README documenting page sizes (A4, Letter), borders, and alpha-channel behavior.
- Standard
--helpcovers all layout and rotation flags
Security, Auth & Guardrails
None required; operates purely on local image files or stdin.
Free LGPL-3.0-or-later open-source Python CLI.
# 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
img2pdf --help
Displays page-size, layout, and rotation options without reading or writing assets.
Controlled Writes & Previews
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
--nodateand--pagesizefor reproducible, clean document generation.
Caveats & Pitfalls
- ! Refuses PNGs with alpha channels by default unless flattened or passed with
--pillow-limit-pixelsworkarounds. - ! Writing without
-ooutputs raw binary PDF bytes to stdout.