Understanding DPI and JPEG Quality in PDF Compression
What DPI and JPEG quality actually mean, how they affect file size and visual quality, and how to choose the right values.
Two Levers, One Goal
When compressing PDFs, two settings control the trade-off between quality and file size:
- DPI (dots per inch) — how many pixels per inch an image contains
- JPEG quality — how aggressively the image data is compressed
Understanding these two values helps you pick the right preset and know what to expect.
DPI: Resolution
DPI determines how much detail an image holds. Higher DPI = more pixels = sharper image = bigger file.
| DPI | Pixels for an A4 page | Best for |
|---|---|---|
| 72 | 595 x 842 | Minimal size, basic readability |
| 96 | 794 x 1123 | Screen reading |
| 150 | 1240 x 1754 | General purpose |
| 200 | 1654 x 2339 | Detailed documents |
| 300 | 2480 x 3508 | Print quality |
What PulpPDF Does with DPI
In the standard presets (High Quality, Balanced, Maximum), DPI is used as a cap. If an embedded image is already at or below the target DPI, it's left alone. If it's higher, it's downscaled.
In Ultra mode, DPI controls the rasterization resolution — every page is rendered at the chosen DPI, regardless of original content.
JPEG Quality: Compression Ratio
JPEG quality is a number from 0 to 100 that controls how much visual data is discarded:
| Quality | Visual result | Typical file size |
|---|---|---|
| 95-100 | Visually lossless | Large (minimal savings) |
| 85 | Excellent — differences invisible at normal zoom | ~50% of original |
| 60 | Good — minor artifacts visible at 200%+ zoom | ~25% of original |
| 35 | Acceptable — visible softening, text still readable | ~12% of original |
| 10-20 | Poor — heavy blocking artifacts | Very small |
The Sweet Spot
For most documents viewed on screen, JPEG 60% at 150 DPI (PulpPDF's Balanced preset) is the sweet spot. Text remains crisp, photos look good at normal viewing size, and files shrink by 40-70%.
For printing, JPEG 85% at 300 DPI (High Quality) preserves enough detail for professional output.
How PulpPDF's Presets Map
| Preset | JPEG Quality | DPI | Strategy |
|---|---|---|---|
| None | — | — | No compression |
| High Quality | 85% | 300 | Light touch |
| Balanced | 60% | 150 | Best balance |
| Maximum | 35% | 72 | Aggressive |
| Ultra | 40% | 72-300 (your choice) | Full rasterization |
Common Questions
Does lowering DPI affect text?
In standard presets, no. Text in PDFs is stored as vectors (font outlines), not images. DPI only affects embedded raster images like photos, scans, and diagrams. Text stays razor-sharp at any DPI.
In Ultra mode, yes — the entire page is rasterized, including text. That's why Ultra is the "nuclear option."
Can I compress a PDF twice?
You can, but it rarely helps. Re-compressing already-compressed JPEG images adds artifacts without meaningful size reduction. PulpPDF's image recompression only replaces an image if the new version is actually smaller.
What about PNG images in PDFs?
PulpPDF handles them. Embedded PNGs (stored as FlateDecode streams) are decoded, optionally resized, and re-encoded as JPEG. This often produces dramatic savings since PNG is lossless and typically much larger than JPEG for photographic content.
