Image to PDF April 27, 2026 · 6 min read

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.

How to Convert Images to PDF With Small File Size
AT

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:

  1. Original image resolution — a 12MP camera photo at full resolution is ~3–8MB before any processing
  2. Image format in the PDF — TIFF stored losslessly vs. JPEG compressed
  3. Number of pages — 20 pages × 2MB = 40MB
  4. 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

PurposeRecommended DPIColor ModeTypical File Size/Page
Web/screen viewing72–96 DPIGrayscale50–150 KB
Email sharing150 DPIGrayscale100–300 KB
Printing300 DPIColor500 KB–2 MB
Legal archiving300 DPIGrayscale300–800 KB
Photo books300–600 DPIColor2–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:

  1. Upload your images
  2. Select Compression Level: Low (best quality), Medium (balanced), High (smallest size)
  3. For documents: choose “Text/Document” optimization
  4. 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
)
Image files optimized and converted to compact PDF

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

OriginalAfter /ebook CompressionReduction
10 scanned pages (300 DPI color)8MB → 1.2MB85%
5 phone photos15MB → 2MB87%
20 TIFF scans45MB → 5MB89%
Already-compressed JPGs3MB → 2.4MB20%

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.

Compact PDF document with optimized image compression

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