Optimizing SVG

Optimizing SVG through Illustrator

Adobe® Illustrator® allows customization of exported SVG in order to optimize file size through such controls as "Simplify," font embedding, and gzip compression. These controls should be used to produce the most streamlined files possible from Illustrator.

Complex images (particularly auto-traced or imported images from other applications such as Adobe Streamline™ or Adobe Dimensions®) should be passed through the Path Simplify filter before exporting. Fewer vector points mean smaller character count in the overall SVG file.

Font embedding should be used when you require the display of a specific font that the user may not have installed on their system. Otherwise, as in the case of logos, the text should be converted to outlines. In creating embedded fonts, you should always select the smallest possible option (see text lesson for details). The "All Glyphs" option should be used only rarely. Also, when creating multiple SVG files that use the same font, instead of creating multiple subsetted fonts, create one font that can be referenced by all of the files. The font becomes cached on the client side, and so once downloaded, will apply to all documents quickly.

Gzip compression is a new option in the current release of the Illustrator SVG Format plug-in, and can cut down SVG file size significantly. Here are some statistics from the current specification:

Uncompressed SVG
W/gzip compression
Compression ratio
30,203
8,680
71%
12,563
3,048
83%
7,106
2,395
66%
6,216
2,310
63%
4,281
2,198
49%

Other methods of optimization

There are many ways of optimizing your SVG files by hand outside of Illustrator.

Non-optimized SVG
3.64 kb

Optimized SVG (<use>, gzip)
0.99 kb

JPEG (medium quality)
9.62 kb

GIF (256 colors)
12.77 kb

Next lesson: Viewer Auto-Install

Copyright ©2000 Adobe Systems Incorporated. All rights reserved.
Terms of Use
Online Privacy Policy