EnglishРусскийTürkçeDeutschFrançais About · RSS
WebInterface.org
WebInterface.org

Notes on drawing, print, photographs, and pictures made by computer.

Home · Computer graphics · Scalable Vector Graphics

Scalable Vector Graphics

Scalable Vector Graphics is an XML format for two-dimensional pictures, with support for interaction and for animation. The specification is an open standard. The World Wide Web Consortium has worked on it since 1999. An SVG image is stored as text. Because the picture is vectors rather than a grid of pixels, you can scale it without the edges falling apart. Because the file is text, it can be searched, indexed, scripted, and compressed. You can write it in a text editor or in a vector drawing program. Most web browsers will draw it.

A file can also contain JavaScript. That is useful when you meant it, and it is a reason to be careful when the file came from someone else.

Six proposals, then a new language

Through 1998, six competing proposals for a vector language on the web were sent to the W3C.

  • Web Schematics, from CCLRC
  • Precision Graphics Markup Language, from Adobe, IBM, Netscape, and Sun
  • Vector Markup Language, from Autodesk, Hewlett-Packard, Macromedia, Microsoft, and Vision
  • Hyper Graphics Markup Language, from Orange UK and PRP
  • WebCGM, from Boeing, PTC, InterCAP, Inso, CCLRC, and Xerox
  • DrawML, from Excosoft

The early SVG working group, chaired by Chris Lilley, decided not to adopt any of the commercial submissions as it stood. They wrote a new markup language, informed by those proposals and not really based on any one of them. That decision is why SVG does not read as "Adobe's format with the names changed," or as Microsoft's. People who had shipped a proposal still recognise pieces. Nobody got to own the result.

Early adoption was thin, mostly because older versions of Internet Explorer did not draw it. By 2011 every major desktop browser had some level of support. Native support has plain advantages. You do not need a plugin. SVG can sit in the same document as other content. Rendering and scripting are more reliable when the browser itself is responsible, rather than a piece of software bolted on. Mobile support arrived in pieces. Different devices and browsers implemented SVG Tiny 1.1 or 1.2, which are reduced profiles of the full language. On a web page, the useful form is often inline SVG: the drawing written inside the HTML document rather than fetched as a separate image. Flat pictures explains why a vector description is the right tool for a mark that has to stay sharp. SVG is that description, written down as a standard.

The versions

SVG 1.0 became a W3C Recommendation on 4 September 2001. SVG 1.1 followed on 14 January 2003. The main change in 1.1 was to split the specification into modules, so that subsets could be defined as profiles. Apart from that, 1.1 and 1.0 are close. The same day, SVG Tiny and SVG Basic, the mobile profiles, also became Recommendations. They are profiles of 1.1, not a different language.

SVG Tiny 1.2 became a Recommendation on 22 December 2008. It had started life as a profile of a planned SVG Full 1.2. That full version was dropped in favour of SVG 2, and Tiny 1.2 was rebuilt as a specification of its own. Support for it has generally been poor. SVG 1.1 Second Edition, published on 16 August 2011, gathers the errata and the clarifications. It adds no new features. In 2020 an IETF draft described SVG Tiny 1.2 Portable/Secure, a tighter subset, also called SVG Tiny P/S. That subset is a requirement of the BIMI draft, the work on brand marks in email. A tiny, locked-down drawing is a different product from a drawing that can run a script, and the email case wants the first one.

SVG 2 removes or deprecates some of 1.1 and takes features from HTML5 and from the Web Open Font Format. Several font elements, glyph and altGlyph among them, go away, replaced by WOFF. The xml:space attribute is deprecated in favour of CSS. HTML features such as translate and data-* attributes are added. Some text-handling ideas from Tiny 1.2 are marked for inclusion and are not yet formalised. SVG 2 is not, in general, a superset of Tiny 1.2. It reached Candidate Recommendation on 15 September 2016. Revised candidate texts appeared on 7 August 2018 and 4 October 2018. A later draft is dated 14 September 2025. The practical consequence for someone writing a file today is dull and useful. SVG 1.1 is what browsers actually agreed on. SVG 2 is where the specification is walking. A file that sticks to the widely implemented part of 1.1 will draw. A file that depends on a 2 feature needs a check against the browser, not against the draft.

What the file is good at

SVG is used for web drawings and for print. It compresses well with gzip. A compressed file is called SVGZ and is typically 20 to 50 percent smaller than the original. The format also carries metadata, which makes indexing and search less of a guess than they are for a photograph. What an SVG file contains is the inventory of those pieces: paths, text, paint, filters, animation. The specification is maintained by the W3C, and the current text lives with them.

Earlier: Were VR graphics ahead of their time?Later: What an SVG file contains