Sub topic 9
Common vector formats
This chapter assumes you know the difference between a raster grid and a vector path, and that you have seen the extensions .svg, .pdf, .eps and .ai. It covers what each vector format stores, where each one is used, and the errors that most often cause trouble when files change hands.
What a vector format has to store
A vector file stores a list of drawing instructions, not pixels. At minimum it holds:
- Shapes, defined as paths made of points and curves.
- Styles, such as fill color, stroke color and stroke width.
- Structure, such as grouping, layering and the order in which objects are painted.
Formats differ in what they add on top of that: text, embedded fonts, gradients, effects, raster images, editing history and interactivity. Those extras decide which format fits which job.
SVG: the vector format of the web
SVG (Scalable Vector Graphics) is an open standard maintained by the W3C. A file is plain XML text, so you can open it in any text editor, search it, compare versions in Git, and compress it well with gzip or Brotli.
The first example draws a rectangle and a circle:
<svg xmlns="http://www.w3.org/2000/svg" width="200" height="100" viewBox="0 0 200 100">
<rect x="10" y="10" width="80" height="80" fill="#2a6fdb"/>
<circle cx="150" cy="50" r="40" fill="#e5484d"/>
</svg>The viewBox defines the internal coordinate system: it starts at 0,0 and is 200 units wide and 100 units tall. The width and height attributes set the displayed size. If the two differ, the browser scales the drawing to fit. This is why SVG stays sharp at any size.
Curves use the path element. The d attribute holds commands such as M (move to) and C (cubic Bézier curve with two control points):
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" width="300" height="300">
<path d="M10 80 C 40 10, 65 10, 95 80" fill="none" stroke="#222" stroke-width="4"/>
</svg>Because the viewBox is 100 by 100, changing width and height to 300 or 3000 does not reduce quality.
What SVG adds beyond shapes
- CSS styling. You can change colors with CSS, including dark-mode variants, when the SVG is inlined in HTML.
- Scripting and animation. JavaScript and SMIL or CSS animation can change shapes at runtime. This works only when the SVG is inlined or loaded as an
object. It does not run when the SVG is loaded through animgelement. - Text. Text can stay as real text, which is searchable and accessible, or be converted to outlines.
- Embedded rasters. An SVG can contain a bitmap. Such a file is not resolution independent, and its size grows quickly.
On the web, an SVG goes in an img element just like a JPEG:
<img src="logo.svg" alt="Company logo" width="120">
<img src="photo.jpg" alt="Mountain lake at sunrise" width="600" height="400">SVG gotchas
- Fonts. If text is live and the viewer lacks the font, the browser substitutes another. Convert text to outlines for logos, or embed the font.
- Size. Exports from design tools often contain editor metadata, unused definitions and excessive decimal precision. A tool such as SVGO can cut file size, but check the result visually, because aggressive settings can remove IDs that your CSS depends on.
- Complexity. A traced photograph with tens of thousands of paths can render slower than the equivalent JPEG.
- Security. An SVG can contain scripts and external references. Do not accept uploaded SVGs and serve them from your own domain without sanitizing them.
- Software support. Some email clients and older office tools do not render SVG. Check the target before choosing it.
PDF: a container for print and documents
PDF (Portable Document Format) was designed to preserve page layout across devices. It is not purely a vector format. A PDF page can hold vector shapes, live text with embedded fonts, and raster images in any mix. Its graphics model is closely related to PostScript, which is why vector drawing in a PDF behaves like other vector art.
Where PDF fits:
- Print delivery. Print shops commonly ask for PDF, often in a standard such as PDF/X, which restricts the file to what a press workflow can handle reliably.
- Multi-page work such as brochures, reports and manuals.
- Sharing a layout that must look identical everywhere.
Points to watch:
- Raster content hides inside. A PDF "logo" may be a screenshot in a PDF wrapper. Zoom in to 800% or more to check.
- Fonts must be embedded or converted to outlines. Missing fonts are a classic cause of reflowed text at the printer.
- Color mode. PDFs can hold RGB, CMYK and spot colors. The print destination decides which one you need. The chapter on web and print delivery covers that decision.
- Editing. Editing a PDF in a vector editor is possible, but the text and object structure can be broken apart or lost. Keep the original source file.
EPS: the older print interchange format
EPS (Encapsulated PostScript) is a single-page, self-contained PostScript fragment. For years it was the standard way to move a logo between design software and layout programs.
Its limits today:
- It does not support transparency natively, so drop shadows and soft edges are flattened or rasterized.
- Browsers do not display it, and many modern applications show only a low-resolution preview image embedded in the file.
- It cannot be edited as text in any practical way, and it is larger and slower than PDF or SVG for the same artwork.
You will still meet EPS when a printer, a stock library or a client's older workflow asks for it. For new work, PDF or SVG is normally the better choice. Keep EPS as an export target, not as your master file.
AI: Adobe Illustrator's working format
An .ai file is the native format of Adobe Illustrator. Modern versions are built on a PDF-based structure with extra Illustrator data, so many programs can read the PDF layer even though they do not understand the whole file.
What AI preserves that others lose:
- Layers, artboards, symbols and named swatches.
- Live effects, gradient meshes, brushes and editable text.
- Linked or embedded images.
The trade-off is dependence on one vendor. Other editors, such as Affinity Designer, Inkscape and CorelDRAW, open .ai files with varying fidelity. Treat AI as a source format: edit in it, then export SVG, PDF or PNG for delivery. Do not send it to people who only need to view or place the artwork.
Other vector formats you may meet
- Inkscape SVG is SVG with extra editor-specific data, such as layer names. It is still valid SVG, but exporting "plain SVG" for the web removes the extras.
- Compressed SVG (.svgz) is gzip-compressed SVG. Servers can usually do this automatically, so you rarely need it.
- DXF and DWG are vector formats for CAD and engineering. They describe lines and arcs at real-world dimensions, and they are not designed for illustration.
- Fonts (TrueType, OpenType) store glyph outlines as vector curves. This is why text scales cleanly.
Comparing the main formats
| Format | Native editing | Browser display | Typical use | Main limitation |
|---|---|---|---|---|
| SVG | Any text or vector editor | Yes | Logos, icons, charts, web graphics | Font and security issues, slow with huge path counts |
| Limited, depends on tool | Yes, usually through a viewer | Print delivery, documents | May contain raster content, structure may break on edit | |
| EPS | Illustrator and similar tools | No | Legacy print and stock workflows | No native transparency, aging format |
| AI | Adobe Illustrator | No | Master files for design work | Vendor-specific, partial support elsewhere |
The diagram shows how a typical design project moves between these formats.
Checking a vector file before you deliver it
A short checklist catches most problems:
- Open the file at a very high zoom level. Edges should stay crisp. Blurry edges mean a raster image is inside.
- Check the text. Decide whether it should be live (editable and searchable) or outlined (safe from font substitution).
- Check the color mode against the destination: RGB for screens, CMYK or specified spot colors for print.
- Look at the file size. A simple logo that weighs several megabytes usually carries embedded images or excess metadata.
- Open the file in a second program, or a browser for SVG, to confirm that it renders the same way.
Choosing between them
The decision follows the destination more than the artwork:
- Going on a web page or into an app: SVG.
- Going to a printer or into a document: PDF.
- A recipient specifically requests it: provide EPS, or AI for further editing.
- Keeping the file for future changes: save the native source file, and export copies for everything else.
Exercise
A client sends a file named logo.pdf and asks you to place it on their website as a sharp, scalable logo. When you zoom in to 1000%, the edges turn blurry. What does that tell you, and what should you ask for?
Show answer
The PDF contains an embedded raster image, not vector paths, so it will not scale cleanly. Ask for the original vector source (for example an .ai file) or an SVG export. If none exists, the logo would need to be redrawn or traced, and the result should be checked against the original.
Exercise
You export an SVG logo from a design tool, and on another computer the text appears in a different typeface. Why did this happen, and how do you prevent it?
Show answer
The text was stored as live text, and the second computer did not have the font installed, so the browser substituted another font. Convert the text to outlines before export, or embed or load the font explicitly.