From Pixels to Pages
Converting images to PDF is one of the most versatile file operations you will encounter. The use cases range from simple (turning a single photo into a shareable document) to complex (combining hundreds of scanned pages into a searchable, OCR-enabled PDF with bookmarks and a table of contents).
Whether you are digitizing paper documents, creating photo portfolios, assembling image-based reports, or preparing files for legal or government submission, this guide covers every approach from basic online tools to advanced command-line automation.

Single Image to PDF
The simplest case: you have one image file and need it as a PDF.
Method 1: ConvertIntoMP4 Online
- Go to the PDF converter on ConvertIntoMP4
- Upload your JPG, PNG, TIFF, WebP, or BMP file
- Click Convert
- Download the PDF
The converter automatically sizes the PDF page to match the image dimensions, ensuring no cropping or distortion.
Method 2: macOS Preview
- Open the image in Preview
- Click File > Export as PDF
- Choose your save location
Method 3: Windows Print to PDF
- Right-click the image file
- Select Print
- Choose Microsoft Print to PDF as the printer
- Adjust sizing options (Fit, Fill, or actual size)
- Click Print and choose a save location
Method 4: Chrome Browser
- Open the image in Chrome (drag it into the browser window)
- Press Ctrl+P (or Cmd+P)
- Set Destination to Save as PDF
- Click Save
Multiple Images to PDF
Combining multiple images into a single multi-page PDF is more common than single-image conversion. This is essential for:
- Scanned documents (one image per page)
- Photo portfolios and lookbooks
- Image-based reports
- Receipt and invoice archives
- Legal document packages
Method 1: ConvertIntoMP4 Online
The image converter on ConvertIntoMP4 supports multi-image PDF creation:
- Upload multiple images at once (drag and drop works)
- Reorder images by dragging them into the desired sequence
- Select PDF as the output format
- Click Convert
Method 2: macOS Preview
- Open the first image in Preview
- Show the sidebar (View > Thumbnails)
- Drag additional images into the sidebar to add pages
- Reorder by dragging thumbnails
- Click File > Export as PDF
Method 3: ImageMagick
# Combine multiple images into one PDF
magick img1.jpg img2.jpg img3.jpg output.pdf
# Combine all JPGs in a directory (sorted by name)
magick *.jpg combined.pdf
# Combine with specific page size (Letter)
magick *.jpg -page Letter combined.pdf
# Combine with specific page size and image fitting
magick *.jpg -resize 2550x3300 -gravity center -extent 2550x3300 combined.pdf
Method 4: Python with Pillow
from PIL import Image
import os
def images_to_pdf(image_paths, output_pdf):
images = []
for path in image_paths:
img = Image.open(path)
if img.mode == 'RGBA':
# Convert RGBA to RGB (PDF doesn't support transparency)
background = Image.new('RGB', img.size, (255, 255, 255))
background.paste(img, mask=img.split()[3])
images.append(background)
else:
images.append(img.convert('RGB'))
if images:
images[0].save(
output_pdf,
save_all=True,
append_images=images[1:],
resolution=150
)
print(f"Created {output_pdf} with {len(images)} pages")
# Usage
image_files = ['scan_001.jpg', 'scan_002.jpg', 'scan_003.jpg']
images_to_pdf(image_files, 'document.pdf')
Method 5: Python with img2pdf (Lossless)
The img2pdf library is special because it embeds JPEG images directly into the PDF without re-encoding them. This means zero quality loss and faster processing.
pip install img2pdf
import img2pdf
# Simple conversion
with open("output.pdf", "wb") as f:
f.write(img2pdf.convert(["page1.jpg", "page2.jpg", "page3.jpg"]))
# With specific page size (A4)
a4_layout = img2pdf.get_layout_fun(
pagesize=(img2pdf.mm_to_pt(210), img2pdf.mm_to_pt(297))
)
with open("output.pdf", "wb") as f:
f.write(img2pdf.convert(
["page1.jpg", "page2.jpg"],
layout_fun=a4_layout
))
Pro Tip: When combining scanned document pages into a PDF, use img2pdf instead of Pillow or ImageMagick. It embeds JPEG data directly without re-compression, preserving the original scan quality. Re-encoding scanned images through another JPEG compression pass visibly degrades text readability.
Page Sizing Options
How the image maps to the PDF page is one of the most important decisions in the conversion. There are several approaches:
Page Fits Image (Default)
The PDF page is sized to match the image dimensions exactly. A 3000x2000 pixel image at 300 DPI produces a 10x6.67 inch page.
This is ideal for photographs and artwork where you want the entire image visible without any margins or cropping.
Image Fits Standard Page
The image is scaled to fit a standard page size (Letter, A4, Legal, etc.) with optional margins.
| Page Size | Dimensions (inches) | Dimensions (mm) | Best For |
|---|---|---|---|
| Letter | 8.5 x 11 | 216 x 279 | US business documents |
| A4 | 8.27 x 11.69 | 210 x 297 | International standard |
| Legal | 8.5 x 14 | 216 x 356 | Legal documents |
| A3 | 11.69 x 16.54 | 297 x 420 | Large format, posters |
| A5 | 5.83 x 8.27 | 148 x 210 | Booklets, small prints |
Image-to-Page Mapping Options
| Option | Behavior | Best For |
|---|---|---|
| Fit | Scale to fit within page, maintaining aspect ratio | General use |
| Fill | Scale to fill page, cropping edges if needed | Full-bleed printing |
| Stretch | Distort to fill page exactly | Rarely appropriate |
| Center | Place at original size, centered on page | Small images |
| Tile | Repeat image to fill page | Patterns, backgrounds |
# ImageMagick: fit image to A4 page with margins
magick input.jpg -resize 2380x3368 -gravity center \
-extent 2480x3508 -units PixelsPerInch -density 300 output.pdf
Adding an OCR Text Layer
Scanned documents stored as images are not searchable -- you cannot select text, copy it, or find specific words. Adding an OCR (Optical Character Recognition) layer to your PDF makes the text selectable and searchable while keeping the original image as the visual layer.
Using Tesseract
# Install Tesseract
brew install tesseract # macOS
sudo apt install tesseract-ocr # Ubuntu/Debian
# Convert image to searchable PDF
tesseract scan.jpg output pdf
# Multiple languages
tesseract scan.jpg output -l eng+fra pdf
# Multiple images to searchable PDF
for img in scan_*.jpg; do
tesseract "$img" "${img%.jpg}" pdf
done
Using OCRmyPDF
ocrmypdf is a specialized tool that adds OCR layers to existing PDFs. First convert images to PDF, then apply OCR:
pip install ocrmypdf
# Convert images to PDF first
magick scan_*.jpg document.pdf
# Add OCR layer
ocrmypdf document.pdf document_searchable.pdf
# With specific language and optimization
ocrmypdf -l eng --optimize 2 document.pdf document_searchable.pdf
OCR Quality Tips
| Factor | Recommendation |
|---|---|
| Scan Resolution | 300 DPI minimum (600 DPI for small text) |
| Image Format | TIFF or PNG (lossless) for best OCR accuracy |
| Contrast | High contrast between text and background |
| Skew | Correct any rotation before OCR |
| Language | Specify the correct language for better accuracy |
For a comprehensive guide on OCR workflows, see our article on how to OCR scanned documents.

Compression and Quality Settings
Image-to-PDF conversion offers several opportunities to control the balance between quality and file size.
JPEG Quality in PDF
When embedding JPEG images in PDF, you can control the compression level:
from PIL import Image
img = Image.open('photo.jpg')
img.save('output.pdf', 'PDF', resolution=150, quality=80)
Quality vs File Size Trade-offs
| Setting | Quality | File Size (per page) | Best For |
|---|---|---|---|
| JPEG 95% at 300 DPI | Excellent | 500-800 KB | Archival, printing |
| JPEG 80% at 200 DPI | Very good | 150-300 KB | General documents |
| JPEG 70% at 150 DPI | Good | 80-150 KB | Screen viewing, email |
| JPEG 50% at 100 DPI | Acceptable | 30-60 KB | Web, quick reference |
| PNG at 300 DPI | Perfect | 1-3 MB | Line art, text documents |
When to Use Lossless vs Lossy
- Scanned text documents -- Use high-quality JPEG (85-95%) or PNG. Text must remain readable.
- Photographs -- JPEG 70-80% is usually sufficient
- Line art, diagrams, signatures -- Use PNG or high-quality JPEG. Lossy compression creates artifacts around sharp edges.
- Mixed content -- Default to higher quality (JPEG 85%+) to accommodate both text and images
Pro Tip: For multi-page scanned documents, process each page individually and then combine them. Some pages (like text-heavy pages) benefit from higher quality, while photo pages can use more aggressive compression. The overall PDF size drops significantly compared to using a single quality setting for all pages.
After creating your PDF, you can further optimize it using ConvertIntoMP4's PDF compressor. Our guide on how to reduce PDF file size provides additional strategies.
Common Conversion Scenarios
Scanned Documents
The most common image-to-PDF workflow. Typically involves multi-page documents scanned as individual image files.
Recommended pipeline:
- Scan at 300 DPI in color or grayscale
- Save as TIFF or PNG (lossless for archival) or JPEG at 90%+ quality
- Apply deskew correction if pages are rotated
- Combine into a single PDF using
img2pdf(lossless JPEG embedding) - Add OCR layer with
ocrmypdf - Optimize file size
# Complete pipeline
img2pdf scan_*.jpg -o document.pdf
ocrmypdf --optimize 2 -l eng document.pdf document_final.pdf
Photo Portfolio
Creating a PDF portfolio from a collection of photographs.
Recommended pipeline:
- Resize images to a consistent dimension (e.g., 3000px on the longest side)
- Apply color correction and ordering
- Combine with specific page layout (full-bleed or with margins)
- Add page numbers and optional captions
from PIL import Image, ImageDraw, ImageFont
def create_portfolio(image_paths, output_pdf, page_width=3000, page_height=4000):
pages = []
for path in image_paths:
# Create white page
page = Image.new('RGB', (page_width, page_height), (255, 255, 255))
img = Image.open(path)
# Resize image to fit with margins
margin = 200
max_w = page_width - 2 * margin
max_h = page_height - 2 * margin - 200 # Extra space for caption
img.thumbnail((max_w, max_h), Image.LANCZOS)
# Center image on page
x = (page_width - img.width) // 2
y = (page_height - img.height) // 2 - 100
page.paste(img, (x, y))
pages.append(page)
pages[0].save(output_pdf, save_all=True, append_images=pages[1:], resolution=300)
Receipt and Invoice Archive
Organizing receipts and invoices as a searchable PDF archive.
- Photograph or scan each receipt
- Combine by date or category
- Add OCR for searchability
- Compress for efficient storage
Converting Screenshots to PDF
Screenshots are typically PNG files. When converting to PDF:
- PNG screenshots embed without quality loss
- Keep the original resolution for readability
- Use page-fits-image sizing so text remains sharp
Handling Different Image Formats
Not all image formats convert to PDF equally well. Here are format-specific considerations:
| Source Format | Considerations | Recommended Approach |
|---|---|---|
| JPEG | Most common, embeds directly | Use img2pdf for lossless embedding |
| PNG | Lossless, supports transparency | Convert transparency to white background |
| TIFF | Multi-page, CMYK possible | Handle multi-page TIFF as multi-page PDF |
| WebP | Modern format | Convert to JPEG/PNG first if tools do not support direct embedding |
| HEIC | iPhone photos | Convert to JPEG first using the image converter |
| BMP | Uncompressed, large | Convert to PNG or JPEG first for much smaller PDFs |
| SVG | Vector graphics | Embed as vector in PDF for scalability |
| RAW | Camera raw files | Process and export as JPEG/TIFF first |
For HEIC conversion (common with iPhone photos), see our guide on how to convert HEIC to JPG.
Advanced: Batch Image-to-PDF Conversion
Directory Structure to PDF
Convert an entire directory structure where each folder becomes a separate PDF:
import img2pdf
import os
def directory_to_pdfs(base_dir, output_dir):
os.makedirs(output_dir, exist_ok=True)
for folder_name in sorted(os.listdir(base_dir)):
folder_path = os.path.join(base_dir, folder_name)
if not os.path.isdir(folder_path):
continue
image_files = sorted([
os.path.join(folder_path, f)
for f in os.listdir(folder_path)
if f.lower().endswith(('.jpg', '.jpeg', '.png', '.tiff'))
])
if not image_files:
continue
pdf_path = os.path.join(output_dir, f"{folder_name}.pdf")
with open(pdf_path, "wb") as f:
f.write(img2pdf.convert(image_files))
print(f"Created {pdf_path} ({len(image_files)} pages)")
directory_to_pdfs("./scanned_documents", "./pdfs")
Watch Folder Automation
Set up a folder that automatically converts new images to PDF:
import time
import os
import img2pdf
def watch_and_convert(watch_dir, output_dir, interval=5):
os.makedirs(output_dir, exist_ok=True)
processed = set()
print(f"Watching {watch_dir} for new images...")
while True:
current_files = set(
f for f in os.listdir(watch_dir)
if f.lower().endswith(('.jpg', '.jpeg', '.png'))
)
new_files = current_files - processed
for filename in sorted(new_files):
input_path = os.path.join(watch_dir, filename)
pdf_name = os.path.splitext(filename)[0] + '.pdf'
pdf_path = os.path.join(output_dir, pdf_name)
with open(pdf_path, "wb") as f:
f.write(img2pdf.convert([input_path]))
print(f"Converted: {filename} -> {pdf_name}")
processed.add(filename)
time.sleep(interval)
watch_and_convert("./inbox", "./pdfs")
For more batch processing strategies, see our batch processing guide.

Merging and Splitting Image PDFs
After creating image PDFs, you often need to combine or reorganize them.
Merge Multiple PDFs
Combine several image PDFs into one document:
# Using pdfunite (poppler-utils)
pdfunite doc1.pdf doc2.pdf doc3.pdf merged.pdf
# Using Python (PyPDF2)
from PyPDF2 import PdfMerger
merger = PdfMerger()
merger.append("doc1.pdf")
merger.append("doc2.pdf")
merger.write("merged.pdf")
merger.close()
ConvertIntoMP4's merge PDF tool handles this in the browser with drag-and-drop page reordering.
Split a Large PDF
Extract specific pages from a multi-image PDF:
# Extract pages 5-10
pdftk input.pdf cat 5-10 output pages_5_to_10.pdf
See our guide on how to merge and split PDFs for complete details.
Troubleshooting
Image Appears Cropped in PDF
Cause: Page size is smaller than the image, or margins are cutting into the image. Fix: Use page-fits-image sizing or increase the page size.
PDF Is Extremely Large
Cause: Uncompressed images (PNG, BMP) or very high resolution. Fix: Convert source images to JPEG at 80% quality before creating the PDF, or use the PDF compressor.
Text in Scanned Images Is Not Selectable
Cause: No OCR layer was added.
Fix: Run ocrmypdf on the PDF to add a searchable text layer.
Colors Look Different in PDF
Cause: Color profile mismatch between the image and PDF viewer. Fix: Embed the sRGB color profile in the images before conversion.
Images Appear Rotated
Cause: EXIF orientation metadata is not being honored. Fix: Auto-rotate images based on EXIF data before conversion:
magick mogrify -auto-orient *.jpg
Wrapping Up
Converting images to PDF is a fundamental operation with applications across personal organization, business documentation, legal archival, and creative portfolios. Start with ConvertIntoMP4's PDF converter for quick single or multi-image conversions, use img2pdf for lossless JPEG embedding in automated pipelines, and add OCR with ocrmypdf when you need searchable text.
The key decisions are page sizing (image-fits-page vs page-fits-image), compression quality, and whether to add an OCR layer. Get those right, and your image PDFs will be professional, efficient, and universally readable.
For related workflows, explore our guides on how to merge and split PDFs, how to reduce PDF file size, and how to OCR scanned documents.



