How to Convert Images to PDF With Small File Size
Convert photos and images to compact PDF files — balancing quality and file size for email sharing, web upload, or document archiving.
AltoUnlockPDF Team
PDF Tools Expert
Converting images to PDF sometimes produces unexpectedly large files — a 10-page scanned document can end up as a 50MB PDF. This guide explains why and how to produce compact PDFs without sacrificing readable quality.
Why Image-Based PDFs Are Large
When you convert images to PDF, the file size depends on:
- Original image resolution — a 12MP camera photo at full resolution is ~3–8MB before any processing
- Image format in the PDF — TIFF stored losslessly vs. JPEG compressed
- Number of pages — 20 pages × 2MB = 40MB
- Color depth — color vs. grayscale vs. black-and-white (1-bit)
The key insight: most document images don’t need full color or maximum resolution. A contract scanned in color at 600 DPI is 10× larger than the same document in grayscale at 150 DPI — and they look nearly identical on screen or paper.
The Right Resolution for Each Use Case
| Purpose | Recommended DPI | Color Mode | Typical File Size/Page |
|---|---|---|---|
| Web/screen viewing | 72–96 DPI | Grayscale | 50–150 KB |
| Email sharing | 150 DPI | Grayscale | 100–300 KB |
| Printing | 300 DPI | Color | 500 KB–2 MB |
| Legal archiving | 300 DPI | Grayscale | 300–800 KB |
| Photo books | 300–600 DPI | Color | 2–8 MB |
For most shared documents (contracts, forms, notes), 150 DPI grayscale produces excellent readability with very small file sizes.
Method 1: AltoUnlockPDF With Compression Option
When converting images using our Image to PDF tool:
- Upload your images
- Select Compression Level: Low (best quality), Medium (balanced), High (smallest size)
- For documents: choose “Text/Document” optimization
- Convert and download
Method 2: img2pdf (Lossless, Smallest Native Size)
img2pdf inserts images directly without re-encoding:
pip install img2pdf
# Direct conversion — no extra compression
img2pdf photo.jpg -o output.pdf
# With layout for A4
img2pdf photo.jpg --pagesize A4 -o output.pdf
But to reduce size before converting, preprocess the images first:
from PIL import Image
import img2pdf
import io
def optimized_image_to_pdf(image_paths, output_path, max_dpi=150, grayscale=True):
"""Convert images to PDF with size optimization."""
processed_images = []
for img_path in image_paths:
img = Image.open(img_path)
# Convert to grayscale if document (not photo)
if grayscale:
img = img.convert('L')
# Resize if above target DPI
current_dpi = img.info.get('dpi', (72, 72))[0]
if current_dpi > max_dpi:
scale = max_dpi / current_dpi
new_size = (int(img.width * scale), int(img.height * scale))
img = img.resize(new_size, Image.LANCZOS)
# Save as optimized JPEG
buf = io.BytesIO()
img.convert('RGB').save(buf, format='JPEG', quality=70, optimize=True)
buf.seek(0)
processed_images.append(buf.read())
with open(output_path, 'wb') as f:
f.write(img2pdf.convert(processed_images))
print(f"Created optimized PDF: {output_path}")
optimized_image_to_pdf(
['scan1.jpg', 'scan2.jpg', 'scan3.jpg'],
'compact_document.pdf',
max_dpi=150,
grayscale=True
)
Method 3: Ghostscript Post-Processing
After creating the PDF, compress it further:
# Screen quality (72 DPI) — smallest, for web display
gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dPDFSETTINGS=/screen \
-sOutputFile=small.pdf large.pdf
# Ebook quality (150 DPI) — good balance
gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dPDFSETTINGS=/ebook \
-sOutputFile=medium.pdf large.pdf
Typical Size Reductions
| Original | After /ebook Compression | Reduction |
|---|---|---|
| 10 scanned pages (300 DPI color) | 8MB → 1.2MB | 85% |
| 5 phone photos | 15MB → 2MB | 87% |
| 20 TIFF scans | 45MB → 5MB | 89% |
| Already-compressed JPGs | 3MB → 2.4MB | 20% |
Black-and-White Mode for Text Documents
For documents that are purely text (contracts, letters, invoices), 1-bit (black and white) mode produces the smallest possible files:
from PIL import Image
def to_bw_pdf_optimized(image_path):
"""Convert to high-contrast B&W — smallest file size."""
img = Image.open(image_path).convert('L')
# Apply threshold for clean B&W
threshold = 128
img = img.point(lambda x: 0 if x < threshold else 255, '1')
return img
# Process and save
img = to_bw_pdf_optimized('contract_scan.jpg')
img.save('contract_bw.pdf', resolution=200)
A 5MB color scan of a typed letter can often be reduced to under 100KB as 1-bit B&W.
Finding the Right Balance
The tradeoff:
- Too compressed → text becomes blurry, photos look bad, small print unreadable
- Too large → email blocked, upload slow, storage costs
Rule of thumb:
- Legal/medical documents for print: 300 DPI, grayscale
- Everyday documents for digital sharing: 150 DPI, grayscale or color
- Reference-only archives: 96 DPI, grayscale
Test by viewing the output at 100% zoom on your screen — if you can read all text clearly, the quality is sufficient.
Related Articles
TIFF to PDF Converter: Free Online Tools and How to Use Them
Convert single and multi-page TIFF files to PDF using free online tools, desktop software, and command-line utilities.
Read Article
How to Convert Screenshots to PDF (Windows, Mac & Mobile)
Turn screenshots into PDF files on any device — ideal for documenting software bugs, saving web content, and creating step-by-step guides.
Read Article
How to Convert Image to PDF on Android: 5 Free Methods
Turn Android photos and images into PDFs using Google Photos, built-in features, apps, and browser-based tools — all free, no watermarks.
Read Article