← All articles 11 min read

Convert PDF to PNG: 5 Free Methods That Actually Work

PDFs are built for documents — fixed layout, consistent rendering, paginated text. But the moment you need a PDF page as a slide background, a social media graphic, or an image embedded in a blog post, the format works against you. Browsers render PDFs in a viewer, not inline. Most CMSes reject PDF uploads for image fields. Social platforms ignore them entirely.

PNG solves every one of those problems. It renders natively in every browser and image viewer. It supports transparency (useful when extracting charts or diagrams from a PDF). It's pixel-perfect at any zoom level when you render at the right DPI. And every platform — WordPress, Shopify, Instagram, LinkedIn, Slack — accepts PNG without complaint.

This guide covers five free methods to convert PDF to PNG, from a single terminal command to a full GUI workflow, with exact version-pinned instructions for each.


Methods at a Glance

Method OS Batch License Best For
pdftoppm (Poppler 24.04) Windows, macOS, Linux Yes GPL v2 Fast CLI conversion, scripting
ImageMagick 7.1 + Ghostscript 10.03 Windows, macOS, Linux Yes Apache 2.0 / AGPL v3 Build pipelines, existing IM workflows
Python pdf2image 1.17.0 Windows, macOS, Linux Yes MIT Programmatic conversion, automation
macOS Preview macOS only No Proprietary (free) Quick one-off exports
GIMP 2.10 Windows, macOS, Linux Limited GPL v3 Selective page export, editing before save

Method 1 — pdftoppm (Poppler 24.04)

License: GPL v2 (free, open source) Platforms: Windows (via MSYS2 or WSL), macOS, Linux

pdftoppm is part of the Poppler PDF rendering library — the same engine that powers PDF viewing in Evince, Okular, and most Linux desktops. It renders PDF pages to raster images directly, without a Ghostscript intermediary. The result is fast, accurate, and consistent with what the PDF looks like on screen.

Install Poppler:

Convert a PDF to PNG (all pages):

pdftoppm -png -r 300 document.pdf document

This produces document-1.png, document-2.png, etc. — one PNG per page at 300 DPI.

Flags:

Convert a single page:

pdftoppm -png -r 300 -f 3 -l 3 document.pdf page3

Batch convert a folder of PDFs:

for f in *.pdf; do
  base="${f%.pdf}"
  mkdir -p "$base"
  pdftoppm -png -r 300 "$f" "$base/$base"
done

Each PDF gets its own directory. A 10-page PDF named report.pdf produces report/report-1.png through report/report-10.png.

pdftoppm is the fastest CLI option for pure PDF-to-PNG conversion. It does one thing well — no format negotiation, no delegates, no config files.


Method 2 — ImageMagick 7.1 + Ghostscript 10.03

License: Apache 2.0 (ImageMagick) / AGPL v3 (Ghostscript) Platforms: Windows, macOS, Linux

ImageMagick delegates PDF rendering to Ghostscript. This means you need both installed, and the output quality depends on Ghostscript's rendering engine — which is excellent for vector PDFs but occasionally handles embedded fonts differently than Poppler. The advantage is that ImageMagick lets you chain conversions with other image operations (resize, crop, color adjust) in a single command.

Install both tools:

Convert a PDF to PNG:

magick -density 300 document.pdf -quality 100 document.png

This produces document-0.png, document-1.png, etc. — one PNG per page.

Convert a single page:

magick -density 300 "document.pdf[2]" -quality 100 page3.png

Pages are zero-indexed, so [2] is the third page.

Batch convert with resize:

for f in *.pdf; do
  base="${f%.pdf}"
  magick -density 300 "$f" -resize 1920x -quality 100 "${base}-%03d.png"
done

This renders at 300 DPI, then resizes the output so the width is 1920px (maintaining aspect ratio). Useful for producing web-ready images from letter-size PDFs. For more batch processing tips, see our guide on batch resizing images.

Security note: ImageMagick's default policy.xml may block PDF operations for security reasons (the Ghostscript delegate can execute PostScript code). If you get an error like attempt to perform an operation not allowed by the security policy, edit /etc/ImageMagick-7/policy.xml and change the PDF policy line:

<policy domain="coder" rights="read|write" pattern="PDF" />

Only do this on machines where you trust the PDFs you're converting.


Method 3 — Python pdf2image 1.17.0

License: MIT (pdf2image) / GPL v2 (Poppler, required backend) Platforms: Windows, macOS, Linux

pdf2image is a Python wrapper around pdftoppm. It gives you programmatic control — useful when PDF-to-PNG conversion is one step in a larger automation pipeline (report generation, document processing, thumbnail creation).

Install:

pip install pdf2image==1.17.0

You also need Poppler installed on the system (see Method 1 for install commands). pdf2image calls pdftoppm under the hood.

Basic conversion:

from pdf2image import convert_from_path

# Convert all pages at 300 DPI
images = convert_from_path("document.pdf", dpi=300)

for i, image in enumerate(images):
    image.save(f"page-{i + 1}.png", "PNG")

Convert specific pages:

from pdf2image import convert_from_path

# Convert only pages 1-3
images = convert_from_path(
    "document.pdf",
    dpi=300,
    first_page=1,
    last_page=3
)

for i, image in enumerate(images, start=1):
    image.save(f"page-{i}.png", "PNG")

Batch convert a folder:

from pathlib import Path
from pdf2image import convert_from_path

pdf_dir = Path("./pdfs")
out_dir = Path("./output")
out_dir.mkdir(exist_ok=True)

for pdf_file in pdf_dir.glob("*.pdf"):
    images = convert_from_path(pdf_file, dpi=300)
    for i, image in enumerate(images):
        image.save(out_dir / f"{pdf_file.stem}-{i + 1}.png", "PNG")

Memory note: pdf2image loads all pages into memory as PIL Image objects by default. For large PDFs (100+ pages), process in chunks using first_page and last_page to avoid memory exhaustion.


Method 4 — macOS Preview

License: Proprietary (free, included with macOS) Platforms: macOS only

Preview handles single-page PDF exports without any installation. It's the fastest path when you need one or two pages as PNG and don't want to open a terminal.

Export a page as PNG:

  1. Open the PDF in Preview (double-click or open document.pdf)
  2. Navigate to the page you want
  3. FileExport
  4. Set Format: PNG
  5. Set Resolution: use the slider or type a value (default is 72 DPI — bump to 150 or 300 for usable quality)
  6. Click Save

Multi-page workaround: Preview exports only the currently visible page. For multi-page PDFs, select the pages you want in the sidebar (hold Cmd and click), then FileExport Selected PDFs to save each page as a separate one-page PDF. Re-open each and export to PNG. For more than a few pages, switch to pdftoppm — it's faster and scriptable.

Transparency note: Preview's PDF-to-PNG export renders the page with a white background by default. If your PDF has transparent regions (common in vector graphics exported as PDF), the transparency is preserved only if the PDF was authored with a transparent page background. Most document-type PDFs have an opaque white page box.


Method 5 — GIMP 2.10

License: GPL v3 (free, open source) Platforms: Windows, macOS, Linux

GIMP is a full image editor, not a dedicated converter — but it handles PDF import well and lets you edit the page (crop, adjust levels, add annotations) before exporting. Useful when you need to extract a specific region from a PDF page or adjust the rendering before saving.

Install GIMP 2.10:

Import and convert:

  1. Open GIMP
  2. FileOpen → select your PDF
  3. The Import from PDF dialog appears:
    • Select pages: choose which pages to import (hold Shift or Ctrl to select multiple)
    • Resolution: set DPI (300 is the default — change to 150 for screen use, 600 for print)
    • Open as layers: check this to stack all selected pages as layers in one image (useful for comparison); leave unchecked to open each page as a separate image
  4. Click Import
  5. FileExport As → choose a filename ending in .png
  6. In the PNG export options, leave defaults (compression level 9 is fine — it's lossless)
  7. Click Export

Batch in GIMP: GIMP supports Script-Fu and Python-Fu for batch operations, but the scripting interface is cumbersome for simple conversion tasks. If you need batch processing, pdftoppm or pdf2image are significantly more practical.

When GIMP makes sense: You need to crop a chart out of a report PDF, adjust contrast on a scanned document, or add a watermark before saving as PNG. For straight conversion without editing, the CLI tools above are faster.


Choosing the Right DPI

DPI (dots per inch) controls how many pixels the renderer produces per inch of PDF page. A standard US Letter page is 8.5 x 11 inches — the DPI you choose determines the pixel dimensions of your PNG output:

DPI Pixel Size (Letter page) File Size (approx.) Use Case
72 612 x 792 50–150 KB Thumbnails, low-res previews
150 1275 x 1650 200–600 KB Screen viewing, web embeds, presentations
300 2550 x 3300 800 KB – 3 MB Print-quality, detailed diagrams, archival
600 5100 x 6600 3–12 MB High-res archival, OCR source images

The practical default is 300 DPI. It produces sharp output for both screen and print. Drop to 150 if file size matters more than sharpness (blog images, email attachments). Go to 600 only for archival or when you need to zoom into fine details.

After converting at higher DPI settings, your PNG files will be large. Use Pixotter's compressor to reduce file sizes without visible quality loss, or see our guide on how to reduce image size for more strategies.


PNG vs JPG for PDF Conversion

Both work, but they serve different purposes. The right choice depends on what your PDF contains. For an in-depth comparison of the two formats, see our JPG vs PNG guide.

Factor PNG JPG
Compression Lossless — no quality loss Lossy — some detail lost
Transparency Supported Not supported
Best for Text, diagrams, charts, screenshots, UI mockups Photographs, scanned documents, images with gradients
File size Larger for photos, smaller for graphics Smaller for photos, larger for flat graphics
Text clarity Pixel-perfect at any zoom Compression artifacts around text edges

Rule of thumb: If the PDF contains text, line art, charts, or diagrams — use PNG. The lossless compression keeps edges crisp. If the PDF is a scanned photograph or a page heavy on photographic images — JPG at quality 90 produces smaller files with negligible visual difference.

For more about the PNG format itself — color modes, bit depth, and when it outperforms other formats — see What Is PNG?.


FAQ

Q: Does converting PDF to PNG reduce quality?

It depends on DPI. A PDF is resolution-independent (vector-based text and graphics scale to any size). The moment you rasterize it to PNG, you lock in a specific resolution. At 300 DPI, text and vector elements are indistinguishable from the original at normal viewing distances. At 72 DPI, you'll see pixelation. Choose DPI based on your use case (see the DPI table above).

Q: Can I convert a multi-page PDF to a single PNG?

Not directly — each PDF page maps to one PNG file. If you need all pages in a single image, convert each page to PNG first, then stack them vertically using ImageMagick:

pdftoppm -png -r 300 document.pdf page
magick page-*.png -append combined.png

The -append flag stacks images top-to-bottom. Use +append for side-by-side.

Q: How do I convert PDF to PNG with a transparent background?

pdftoppm always renders with a white background. For transparency, use ImageMagick with the -alpha remove flag omitted:

magick -density 300 document.pdf -background none document.png

This preserves transparent areas in the PDF. Note: most document PDFs have an opaque white page box — transparency only matters for vector graphics or design assets saved as PDF.

Q: Why are my converted PNGs so large?

PNG file size grows with DPI and page complexity. A 300 DPI Letter page produces a ~2550 x 3300 pixel image — that's 8.4 megapixels. Full-color pages with gradients or photographs result in large PNGs because PNG's lossless compression can't shrink photographic content as aggressively as JPG. Solutions: lower the DPI to 150, convert to JPG instead of PNG for photographic content, or compress your PNGs after conversion.

Q: Which method is the fastest?

pdftoppm is the fastest pure converter. On a modern laptop, it renders a 10-page Letter PDF at 300 DPI in under 2 seconds. ImageMagick adds Ghostscript startup overhead (roughly 0.5–1 second per invocation). GIMP is the slowest because it loads a full GUI application. For batch jobs of 50+ PDFs, pdftoppm with a shell loop is the clear winner.

Q: Can I automate PDF-to-PNG conversion in a build pipeline?

Yes. pdftoppm and ImageMagick both work in CI/CD environments. For GitHub Actions, add poppler-utils to your apt install step. For Docker, use an image based on debian:bookworm and install poppler-utils. The pdf2image Python library is another good option when your pipeline is Python-based — it wraps pdftoppm with a clean API. For converting between standard image formats after that step, Pixotter's converter handles PNG, JPG, WebP, and AVIF in the browser.

Q: Is there a way to convert PDF to PNG without installing anything?

On macOS, Preview is already installed — no additional setup needed. On other platforms, you need at least one tool installed. Browser-based PDF-to-PNG converters exist, but they upload your file to a remote server for processing. If your PDFs contain sensitive content, a local CLI tool like pdftoppm is the safer choice. For non-PDF image format conversion (PNG to JPG, WebP to PNG, etc.), Pixotter handles it entirely in your browser — nothing is uploaded.

Q: What about the reverse — converting PNG to PDF?

ImageMagick handles it in one command: magick image.png output.pdf. For a full walkthrough including multi-image PDFs and page sizing, see our guide on converting PNG to PDF.


Wrapping Up

pdftoppm is the right default for most people — it's fast, requires only one install (poppler-utils), and produces clean output at any DPI. Use ImageMagick 7.1 when you need to chain PDF rendering with other image operations in a single command. Use pdf2image 1.17.0 when the conversion is part of a Python workflow. Preview handles the occasional one-off on macOS. GIMP is for the cases where you need to edit the page before saving.

Whichever method you choose, the converted PNGs will likely need optimization before they're web-ready. Pixotter's compressor shrinks them in the browser without any upload — drop your PNGs in, get smaller files out.