Skip to content

Print · 6 min read · Updated 2026-09-19

Raster vs vector in a PDF

Every PDF is a hybrid document. Knowing which parts of a page are pixels and which are equations predicts exactly how it will behave under zoom and in print.

Zoom deep into almost any PDF and you will see two different behaviours on the same page. The type stays crisp however far you push it, while the photograph beside it dissolves into squares. That is not a rendering quirk. It is the visible signature of two fundamentally different ways of describing a picture, both of which a PDF is designed to carry at once.

Raster vs vector in a PDF

01

Two ways of describing a picture

A raster image is a grid of samples. It records a colour value for each cell of a fixed rectangular lattice, and that lattice is all it knows — there is no notion of an edge, a shape or a letter, only neighbouring values that happen to differ. This makes raster the natural representation for anything continuous and irregular, which is to say photographs and scans, where no shape description could capture the detail anyway.

A vector image is a set of instructions. It describes geometry: move to this coordinate, draw a straight line to that one, follow this cubic Bézier curve, close the path, fill it with this colour, stroke it with a line of that width. Nothing is sampled, so nothing has a native size. The description is resolution-independent by construction, and the renderer turns it into pixels only at the moment of display, at whatever density the display or printer happens to have.

The consequence is the difference everybody has seen without naming. Enlarging a raster image means asking for detail between samples that were never recorded, and the renderer can only guess — by replicating pixels, which produces blocks, or by interpolating, which produces blur. Enlarging vector geometry means re-evaluating the same equations at a finer grid, so the result is exactly as sharp at 800 per cent as at 100 per cent. Curves stay curved; edges stay edges.

02

How a PDF page mixes the two

A PDF content stream is a sequence of drawing operators, and those operators cover both worlds. Text-showing operators position glyphs whose outlines come from an embedded font program — and those outlines are vector paths, which is why text in a generated PDF is sharp at any zoom. Path operators draw the lines, rectangles, curves and fills that make up rules, borders, charts, logos and diagrams, again as vectors. Image operators paint raster data from an image stream onto a defined rectangle of the page.

So the page you are looking at is typically a vector document with raster inclusions. Headings, body text, table rules and any artwork drawn as geometry are mathematical descriptions occupying very little space. Photographs and scanned material are pixel grids and generally account for most of the file’s bytes. The two are composited together in a single coordinate space, which is why they look like one page even though they behave completely differently under magnification.

This is also the cleanest test of a document’s nature. If you zoom to 600 per cent and the text is still crisp, the file contains real vector text and is a generated PDF. If everything degrades together — type included — then the entire page is one raster image, which means it is a scan or a rasterised export. That distinction determines whether the text can be selected, searched, copied and extracted, or whether it needs OCR before any of that is possible.

03

Rasterising is a one-way door

Converting vector content to raster — rasterising, or flattening to an image — is easy, routine and irreversible. The renderer evaluates the geometry once at a chosen resolution and writes out the resulting pixels, discarding the paths that produced them. From that moment the page has a fixed sampling density, and every property that came from being vector is gone: scalability, selectable text, searchability, and the small file size that geometry enjoys over pixels.

People rasterise for legitimate reasons. It guarantees that a page looks identical everywhere regardless of font availability, it removes the possibility of text being copied or edited casually, and it sidesteps rendering differences between viewers for unusually complex artwork. Those are real benefits and sometimes worth the price. But it is worth being explicit that the price includes the reader’s ability to search the document, a screen reader’s ability to voice it, and usually a considerable increase in file size.

Going the other way is not a conversion at all but a reconstruction. Turning a raster page back into vector content means detecting shapes and characters and inferring the geometry that might have produced them — which is what OCR does for text and what tracing does for line art, and both are inference with an error rate rather than recovery of something stored. The practical rule follows directly: keep vector content vector for as long as possible in a workflow, and rasterise only at the last step, deliberately, when you know why.

Worth repeating

MyPDFilles tools described here run on your device.

When an article refers to a MyPDFilles tool, its parsing, compression or recognition runs in JavaScript and WebAssembly inside your browser tab on bytes read from your disk. Educational references to external software are not covered by that claim; review the external provider’s own privacy and security information.

How to verify MyPDFilles processing

Questions on this topic

How can I tell whether a PDF page is vector or raster?

Zoom to several hundred per cent and look at the text. Crisp letterforms mean vector text drawn from an embedded font; blocky or blurred letterforms mean the page is a raster image. Trying to select the text with the cursor is an equally quick check — an image of text cannot be selected.

Are photographs in a PDF ever vector?

Effectively never, and it would be a bad idea. A photograph is continuous irregular detail with no shape structure to describe, so a vector version would need an enormous number of tiny filled paths to approximate what a pixel grid records compactly. Raster is the correct representation for that content.

Does converting a PDF to PNG or JPG lose the vector text?

Yes. Both are raster formats, so the conversion evaluates the page geometry at one resolution and stores the resulting pixels. The output looks right at that size, but the text is no longer text and the page can no longer be scaled up without softening.

Why is a vector diagram so much smaller than an image of it?

Because it stores instructions rather than samples. A rule described as a line between two coordinates with a stroke width takes a handful of bytes; the same rule as a raster occupies a colour value for every pixel it covers, and pays again at higher resolution.