Context: vector graphics

How to choose the appropriate (vector) graphics format

Until very recently, support for vector graphics in HTML browsers was virtually nonexistent. Only now has some widely distributed plugins are available that can handle vector graphics, from which you can choose.

Some things to consider when choose which vector graphics format are:

  • Installed User Base. Currently the only way to display vector graphics in popular web browsers is through an appropriate plugin. Thus it is necessary for the plugin to be installed on the user's computer before the graphic can be displayed. This is the biggest problem with displaying vector graphics today, as not all user have the plugin installed. Thus for maximum usability, you may like to include a (perhaps lower-resolution) bitmap equivalent along with your graphic. (For advice on how to choose an appropriate bitmap format, see ymelup's excellent writeup.)
  • "Features". You want to check whether both the format itself and the most popular plugin for that format are able to support the features that you might want. For example, a format may support alpha transparency, but if the plugin omits that in their implementation, it's still no good.
  • Ease of Generation. If you are simply generating a static graphic, then this is not too big a problem. The main concern would be the cost of the generator. But if you wish to dynamically generate vector graphics, then you have to consider how tractable is it to generate it from scripting lanugages like Perl and PHP.

At the time of writing, there are really one pure vector format: Scalable Vector Graphics. This is an XML-based format that, at least from the specifications, is quite capable of displaying complex vector graphics. Because it is a text-based format, it is quite easy to generate. Adobe has begun distributing a SVG plugin from version 5 of Acrobat Reader. The caveat here is while almost everybody has some form of Acrobat Reader, not everybody has version 5. It may take a year or two for the pickup to be enough to take this format seriously for regular use.

Whilst these are not strictly vector formats, these can also be used to display vector graphics:

  • Macromedia Flash, with just one frame. Again, almost everyone has the Flash plugin. The specifications have been released to the public, and languages like PHP do support on-the-fly flash creation.
  • Java. You can write a Java applet that just displays the graphic. Despite Microsoft's efforts, there is still a significant user base for the JVM. The disadvantage here is that such applets may not be resized easily.

The problem with these methods is that the user cannot copy the graphic as a vector and paste it intact in, say, Adobe Illustrator.