ovid-0.1.2 is not a library.
Fast, bidirectional PDF to image converter and image to PDF merger. A replacement for most pdf and image CLI libraries.
Install
Pre-built binaries (macOS & Linux):
|
Cargo:
macOS:
Linux (Debian/Ubuntu):
Usage
Split - PDF to images
# All pages to PNG at 300 DPI (default)
# Specific pages, JPG format, custom DPI
# Grayscale output
# Single page to stdout (pipe to other tools)
# Smaller PNG files (~2.5x smaller, ~20% slower)
# JPEG quality control
Merge - images to PDF
# Merge images into a PDF
# Merge a whole directory of images
# Set page size (scales images to fit, centered)
# Add PDF metadata
# Supports PNG, JPEG, TIFF, BMP, and GIF
# Write PDF to stdout
Options
-j, --threads <N> Number of parallel threads (default: all CPUs)
-q, --quiet Suppress progress output
-d, --dpi <DPI> Rendering/sizing DPI, 72-2400 (default: 300)
Shell completions
# Bash
# Zsh
# Fish
Performance
Split (PDF to Images)
macOS — Apple M3 Pro
150-page PDF, 300 DPI:
| Tool | PNG | JPG |
|---|---|---|
| ovid | 0.44s | 0.55s |
| mutool | 12.5s | — |
| Ghostscript | 19.6s | 2.78s |
| pdftoppm | 74.7s | 3.44s |
Speedups (150pg, 300 DPI):
| Format | vs mutool | vs Ghostscript | vs pdftoppm |
|---|---|---|---|
| PNG | 28x | 44x | 169x |
| JPG | — | 5.1x | 6.3x |
Scaling across document sizes (ovid only):
| Config | 15-page | 50-page | 150-page |
|---|---|---|---|
| PNG 150dpi | 0.13s | 0.24s | 0.36s |
| PNG 300dpi | 0.19s | 0.29s | 0.46s |
| JPG 150dpi | 0.13s | 0.23s | 0.37s |
| JPG 300dpi | 0.19s | 0.29s | 0.43s |
Linux — 2-core x86_64 VPS
150-page PDF, 300 DPI:
| Tool | PNG | JPG |
|---|---|---|
| ovid | 1.44s | 1.89s |
| mutool | 15.7s | — |
| Ghostscript | 25.2s | 2.89s |
| pdftoppm | 85.8s | 4.12s |
Speedups (150pg, 300 DPI):
| Format | vs mutool | vs Ghostscript | vs pdftoppm |
|---|---|---|---|
| PNG | 11x | 18x | 61x |
| JPG | — | 1.6x | 2.2x |
Merge (Images to PDF)
50 images, 300 DPI:
| Config | ovid | img2pdf | ImageMagick |
|---|---|---|---|
| PNG | 38ms | 3.03s | 11.15s |
| JPG | 14ms | 115ms | 4.65s |
Contributions
Contributions are, of course, always welcome and encouraged. Please make sure they're grounded in reality.
License
MIT