Format Guide16 min read

9 Ways to Convert a PDF to JPG or PNG (Without Losing Quality)

Turn PDF pages into images with pdftoppm, ImageMagick, Ghostscript, Preview, Acrobat and browser tools. Why DPI decides everything, and the ImageMagick error that stops most people.

By ImageGuide Team·Published August 15, 2026·Updated August 15, 2026
pdfpdf to jpgpdf to pngconversiondpirasterization

Converting a PDF to images sounds like a format change. It is not. It is rasterization: throwing away a page description and replacing it with a grid of pixels.

That distinction explains every problem people hit. The text was infinitely sharp and is now fixed at whatever resolution you asked for — and if you did not ask, you got 72 DPI and a blurry result. This guide covers nine methods, and spends most of its length on the two decisions that actually matter: how many dots per inch, and which output format.

Pick Your Method First

# Method Cost Batch? Set DPI?
1 Browser converter Free Yes Yes
2 macOS Preview and Automator Included Yes Yes
3 Windows built-ins Included No No
4 pdftoppm Free Yes Yes
5 pdftocairo Free Yes Yes
6 ImageMagick Free Yes Yes
7 Ghostscript Free Yes Yes
8 Python (PyMuPDF) Free Yes Yes
9 Adobe Acrobat Subscription Yes Yes

DPI Is the Whole Game

A PDF page has a size in inches and no pixels at all. You choose how many pixels to generate per inch, and that single number decides both sharpness and file size.

DPI A4 page becomes Use for
72 595 × 842 Thumbnails only
150 1240 × 1754 On-screen reading, web display
300 2480 × 3508 Printing, OCR, most work
600 4960 × 7016 Small print, archival OCR

Almost every tool defaults to 72, which is why the standard complaint about PDF-to-image conversion is that the text came out fuzzy. Nothing was lost by the format; you asked for a thumbnail.

Doubling the DPI quadruples the pixel count. The file size does not grow quite that fast on a text page, because the extra pixels are mostly more white space, but it grows steeply:

Output Size by Render Resolution

One page of body text rendered with pdftoppm to PNG at each DPI.

At 72 DPI that page is 596×843 pixels — unreadable in print. At 600 it is 4966×7024 and eleven times the size for detail no printer resolves. Pick the lowest number that serves the purpose, which is 150 for screen and 300 for almost everything else.

The Ceiling You Cannot Cross

There are two kinds of PDF page, and they behave completely differently.

A vector page — text, shapes and fonts, produced by Word, LaTeX, Illustrator or a browser’s print function. It has no resolution. Render it at 1200 DPI and it is genuinely sharp at 1200 DPI.

A scanned page — a photograph of paper, embedded as a JPEG inside the PDF. It already has a fixed pixel count. If it was scanned at 200 DPI, rendering at 600 DPI produces a file nine times larger with exactly the same detail, just softly interpolated.

Check which you have before choosing a number:

# Lists every embedded image, with its real pixel dimensions and DPI
pdfimages -list document.pdf

If that prints a row per page with an x-ppi of 200, then 200 is your ceiling. If it prints nothing, the page is vector and you can render as high as you like.

JPG or PNG?

This choice matters more here than almost anywhere else, because PDF pages are usually text.

PNG for anything with text, lines, tables or diagrams. It is lossless, so letter edges stay clean. It also compresses flat-coloured regions extremely well, which on a document page means PNG usually wins on size too.

JPG for pages that are mostly photographs, such as a scanned magazine or a photo book.

The same page of body text, rendered at 300 DPI three ways:

One Text Page at 300 DPI

Rendered with pdftoppm. PNG is lossless; the JPEG is quality 90.

The JPEG is 2.6× larger and lossy, which is the worst of both. JPEG’s artifacts cluster exactly where contrast is highest, and on a document page that means around every character. That produces the grey halos you see in bad scans, and it measurably lowers OCR accuracy.

Note also how little grayscale saves on a rendered page — 3% here, because the page is nearly monochrome already. On a colour scan of paper, where every pixel carries some tint, -gray saves far more.

If you are converting a PDF so you can run text recognition on it, use PNG at 300 DPI and nothing else.

1. A Browser Converter

The quickest route, with no install and no upload.

Both run in your browser through WebAssembly, so the PDF never reaches a server. That matters here more than for most conversions, because the PDFs people convert are contracts, bank statements, invoices and scanned identity documents.

When This Is the Right Answer

  • A few pages, right now
  • A document you would not want sitting in a stranger’s upload folder
  • A machine where you cannot install command-line tools

2. macOS Preview and Automator

Preview handles a single page well and multiple pages badly.

  1. Open the PDF in Preview
  2. Select the page in the sidebar
  3. FileExport
  4. Choose JPEG or PNG, then set Resolution in the dialog

That resolution field is the DPI control, and it defaults to 72. Set it to 150 or 300. Preview exports only the visible page, so a 40-page document means 40 exports.

Automator does the batch:

  1. Open Automator, create a new Quick Action
  2. Set it to receive PDF files in Finder
  3. Add the Render PDF Pages as Images action
  4. Set the format and the resolution in that action
  5. Add Move Finder Items to choose a destination, then save

Now any PDF in Finder converts through the right-click menu. This is the only no-install batch route on macOS.

There is also a one-liner, since macOS ships Python and Quartz tooling, but pdftoppm via Homebrew is simpler and faster than either.

3. Windows Built-Ins

Being straight about this: Windows has no built-in way to convert a PDF to images, in batch or otherwise. Anyone telling you otherwise is describing a screenshot.

What you can do without installing anything:

  • Snipping Tool (Win + Shift + S) captures one page at whatever size it appears on screen. On a 1080p monitor that is roughly 100 DPI, which is below reading quality for print.
  • Microsoft Edge opens PDFs and can print them, but only to another PDF.

For one page to paste into a chat message, the Snipping Tool is fine. For anything else, use method 1 (nothing to install) or install poppler for method 4.

# Poppler on Windows, via winget
winget install oschwartz10612.Poppler

4. pdftoppm

The best default. Part of poppler-utils, fast, and it does exactly one thing.

# Install
sudo apt install poppler-utils     # Debian/Ubuntu
brew install poppler               # macOS

# Every page to PNG at 300 DPI, named page-01.png, page-02.png ...
pdftoppm -png -r 300 document.pdf page

# JPEG instead, with a quality setting
pdftoppm -jpeg -jpegopt quality=90 -r 300 document.pdf page

# One page only
pdftoppm -png -r 300 -f 7 -l 7 document.pdf page

# A range
pdftoppm -png -r 150 -f 1 -l 10 document.pdf preview

# Target a pixel width instead of a DPI, which is what you want for the web
pdftoppm -png -scale-to-x 1600 -scale-to-y -1 document.pdf web

# Grayscale: a large saving on colour scans, a small one on rendered pages
pdftoppm -png -gray -r 300 document.pdf page

-scale-to-x 1600 -scale-to-y -1 is the underused one. It fixes the output width and derives the height from the page aspect ratio, so mixed-size pages all come out at the same width. For anything destined for a web page, that is more useful than a DPI.

The digits in the output filename are padded automatically to match the page count, so page order survives an alphabetical sort.

5. pdftocairo

Also from poppler, rendering through Cairo instead of Splash. Same interface, three differences worth knowing.

# Same flags as pdftoppm
pdftocairo -png -r 300 document.pdf page

# Transparent background instead of white
pdftocairo -png -r 300 -transp document.pdf page

# Straight to SVG, keeping the page as vector
pdftocairo -svg -f 1 -l 1 document.pdf page.svg

Use it when you want transparency. pdftoppm always paints white behind the page. -transp leaves it empty, which is what you need when the page is a logo or diagram you will place on a coloured background.

Use it when you want to stay vector. -svg does not rasterize at all. A diagram or a logo that arrived inside a PDF comes out as a scalable SVG with the shapes intact. It handles one page at a time, and complex pages produce large files, but nothing else on this list preserves the vectors. Our image to vector guide covers what to do when you only have a raster.

Its text rendering differs slightly. Cairo’s anti-aliasing is a touch softer than Splash’s. On small text at low DPI, try both and pick.

6. ImageMagick

Everybody reaches for this first, and it is the one with the most ways to go wrong. ImageMagick cannot read PDFs by itself — it hands the file to Ghostscript. Both quirks below come from that.

# Correct: -density BEFORE the input file
magick -density 300 document.pdf -quality 90 page-%02d.jpg

# All pages to PNG, on white
magick -density 300 document.pdf -background white -alpha remove -alpha off page-%02d.png

# A single page, counted from zero
magick -density 300 document.pdf[0] first-page.png

-density Must Come First

magick -density 300 document.pdf out.png     # renders at 300 DPI ✅
magick document.pdf -density 300 out.png     # renders at 72, then relabels ❌

ImageMagick applies options in the order it reads them. Placed after the input, -density arrives too late to affect rendering: the page was already rasterized at the default 72 DPI. The image is then tagged as 300 DPI, so it reports the right resolution while containing a quarter of the detail. The file looks correct in every property panel and blurry on screen.

This single ordering rule is behind most “ImageMagick makes my PDFs blurry” reports.

The Security Policy Error

On Debian, Ubuntu and most distributions, this is what you actually see first:

attempt to perform an operation not allowed by the security policy `PDF'

Nothing is broken. Distributions disabled PDF handling in ImageMagick’s policy after a series of Ghostscript vulnerabilities that allowed a crafted PDF to execute commands. The rule is deliberate.

You have two options, and the first is better:

  1. Use pdftoppm instead. It does not shell out to Ghostscript, it is faster, and the policy does not apply.
  2. Re-enable it, if you control the machine and trust the files. Edit /etc/ImageMagick-6/policy.xml and remove or comment the line reading <policy domain="coder" rights="none" pattern="PDF" />.

Do not re-enable it on a server that rasterizes PDFs uploaded by other people. That is the exact scenario the policy exists for.

Transparency Comes Out Black

A PDF page has no background. Convert it without saying what to put there and ImageMagick fills the empty area with black in JPEG, or leaves it transparent in PNG where you probably wanted white. -background white -alpha remove -alpha off makes it explicit.

7. Ghostscript

Since ImageMagick is calling Ghostscript anyway, you can call it yourself and skip a layer.

# PNG at 300 DPI
gs -dNOPAUSE -dBATCH -sDEVICE=png16m -r300 \
   -sOutputFile=page-%02d.png document.pdf

# JPEG, with quality
gs -dNOPAUSE -dBATCH -sDEVICE=jpeg -dJPEGQ=90 -r300 \
   -sOutputFile=page-%02d.jpg document.pdf

# Grayscale, for scanned text
gs -dNOPAUSE -dBATCH -sDEVICE=pnggray -r300 \
   -sOutputFile=page-%02d.png document.pdf

# Better text edges at low DPI
gs -dNOPAUSE -dBATCH -sDEVICE=png16m -r150 \
   -dTextAlphaBits=4 -dGraphicsAlphaBits=4 \
   -sOutputFile=page-%02d.png document.pdf

The useful devices are png16m for 24-bit colour, pnggray for grayscale, pngmono for pure black and white, and jpeg with -dJPEGQ.

-dTextAlphaBits=4 is worth adding whenever you render below 300 DPI. It anti-aliases glyph edges with four bits of subpixel precision and makes small text noticeably more readable. It costs nothing.

8. Python, with PyMuPDF

The right choice when conversion is a step inside something larger: a document pipeline, an OCR job, a thumbnail service.

import fitz  # pip install pymupdf

doc = fitz.open("document.pdf")

# 300 DPI: the default is 72, so scale by 300/72
zoom = 300 / 72
matrix = fitz.Matrix(zoom, zoom)

for number, page in enumerate(doc, start=1):
    pixmap = page.get_pixmap(matrix=matrix)
    pixmap.save(f"page-{number:03d}.png")

doc.close()

PyMuPDF bundles its own renderer, so there is no Ghostscript or poppler to install and no security policy in the way. It is also the fastest option on this list by a wide margin.

Two things it gives you that the command-line tools do not:

# Render one region of a page rather than the whole thing
clip = fitz.Rect(0, 0, 300, 300)
pixmap = page.get_pixmap(matrix=matrix, clip=clip)

# Grayscale, and no alpha channel, for a smaller file
pixmap = page.get_pixmap(matrix=matrix, colorspace=fitz.csGRAY, alpha=False)

The alternative, pdf2image, is a thin wrapper around pdftoppm and needs poppler installed separately. PyMuPDF is licensed under AGPL, so check that against your project before shipping it commercially.

9. Adobe Acrobat

FileExport ToImageJPEG or PNG, then open the Settings gear to set the resolution before exporting.

What it offers that the free tools do not:

  • Export all pages or a range through a normal dialog
  • Colour management, so a CMYK print PDF converts to sRGB predictably rather than shifting
  • Batch across many files through Action Wizard

Colour management is the genuine reason to use it. Rasterizing a CMYK print-ready PDF with Ghostscript or poppler gives you a naive conversion, and brand colours drift. Acrobat applies the embedded profiles. If you are producing images from print artwork, that difference is visible. Our colour spaces guide covers why.

The Online Converter Question

The same warning as always, and it applies harder here. PDFs are disproportionately contracts, statements, medical letters, tax forms and scanned passports. Uploading one to a free converter hands that document to a third party under whatever retention policy they publish.

Prefer, in order: a browser-local converter, then a built-in, then a command-line tool. Reserve online services for documents you would be happy to publish.

Getting the Text Instead

A common mistake is converting a PDF to images in order to read the text. That is backwards — rasterizing throws the text away and leaves you needing OCR to guess it back.

# If the PDF already has a text layer, just take it
pdftotext document.pdf output.txt

# Keep the visual layout
pdftotext -layout document.pdf output.txt

If pdftotext returns nothing, the PDF is a scan and OCR is genuinely required. Convert to PNG at 300 DPI, in grayscale, then run recognition on that. Our guide on extracting text from an image covers the free and paid engines.

Watch the Output Size

Rasterization inflates things dramatically. A 2 MB, 50-page vector PDF becomes roughly 400 MB of PNGs at 300 DPI, because a page of text stores as a few kilobytes of instructions and as several megabytes of pixels.

Three ways to keep it under control:

  1. Render only the pages you need, with -f and -l
  2. Use -gray on colour scans of paper, where dropping the tint in every pixel saves a great deal. On a page rendered from a digital PDF it saves very little, because the page is already near-monochrome
  3. Render to a target width, not a DPI, when the destination is a screen

Then compress the results. Our image compressor handles a batch of PNGs, and the reduce file size guide explains what is safe to trade.

Summary

The Nine Methods

# Method Use it when
1 Browser converter A few pages, nothing uploaded
2 macOS Preview and Automator On a Mac with nothing installed
3 Windows built-ins One page, screenshot quality only
4 pdftoppm The default choice for batches
5 pdftocairo Transparency, or keeping vectors as SVG
6 ImageMagick It is already in your pipeline
7 Ghostscript Fine control, no extra layer
8 PyMuPDF Conversion inside a larger program
9 Adobe Acrobat CMYK print artwork, colour accuracy

Checklist

  1. ✅ DPI was set explicitly — 150 for screen, 300 for print and OCR
  2. pdfimages -list confirmed the scan resolution before going above it
  3. ✅ Pages with text went to PNG, photo pages to JPEG
  4. ✅ ImageMagick’s -density came before the input filename
  5. ✅ The background was set explicitly, so nothing came out black
  6. pdftotext was tried first if the goal was the words
  7. ✅ Scanned text was rendered in grayscale to save space
  8. ✅ The document never went to an online converter if it was private

Install poppler and use pdftoppm. Nearly every question on this page has that as its answer, and the two flags that matter are -r and -png.

Going the other way? See 9 ways to convert an image to PDF.

Related Resources

Format References

Ready to optimize your images?

Sirv automatically optimizes, resizes, and converts your images. Try it free.

Start Free Trial