Update: There’s a more practical look at this subject in a later post, Using SVG in background-image.
If adopted widely, the use of SVG in <img /> and background-image could be responsible for some big changes in website design.
Take a look at this example of images in SVG (you’ll need an SVG-capable browser), which displays four photos at random positions and sizes on the page. Images could be pulled at random from Flickr (or wherever) and rotated, resized, and placed in the page as a background. Combined with multiple images, you could create layers of effect, almost like collages… pretty revolutionary.
div { background-image:
url('layer1.svg') left top,
url('layer2.svg') left top,
url('layer3.svg') left top;
}
It looks like Opera will be first to implement this feature with their 9.5 release, previews of which should be available soon. No definitive word on whether they’ll implement multiple backgrounds, but I’m hopeful.
I’m back from my holiday, with a quick look at some of the links I would have discussed in more detail had I been here…
One technology that’s ready to take the step up onto the big stage is SVG. If you’re not sure what that is, its Wikipedia entry provides a good summary:
SVG is an XML markup language for describing two-dimensional vector graphics, both static and animated.
That’s a pretty big deal; static or animated images which are marked up with XML, meaning you can use the DOM to manipulate them. Interactive images; imagine the possibilities!
Gecko is the rendering engine used in browsers such as Firefox, SeaMonkey, Camino, Epiphany, Netscape, and more.
The next version (1.9, currently available as a preview release) introduces a whole load of new features and fixes to the engine. In my last post I mentioned the speed increase thanks to the move to a new graphics layer and changes to rendering order, as well as support for the APNG format and fixes to the CSS to allow it to pass the Acid2 test. But there’s more. Here are some new features of interest to developers:
A little while ago I claimed that SVG looks set to be the future of web graphics
, after Opera’s announcement that SVG would be allowed as a value in the background-image declaration.
Unfortunately Firefox won’t be doing the same with their next release; indeed, it seems that resources are limited at Mozilla;
With minimal resources available for SVG development, we need to make some tough calls regarding prioritizing development efforts in the Firefox 3 time-frame… This means that SMIL and SVG fonts will not make Firefox 3 with the current development resources, and the earliest chance for adding them will likely be in late 2008.
And a comment on the post confirms that the only way to implement SVG for the near future will be using the object tag. Looks like the future of web graphics is still a little way off.
SVG looks set to be the future of web graphics – the distant future, perhaps, as it’s not yet supported by IE without a plugin. Opera’s Chief Web Opener, David Storey, announced on his blog recently that future builds of Opera will support SVG on the CSS background-image declaration. This is very good news, and the potential for scalable layouts is exciting.
The best tool for creating SVG files that I know of is the free, open source, Inkscape, which has just released version 0.45. Inkscape is similar to Illustrator or Freehand; it’s not as polished as these commercial releases but is still very powerful and capable of producing stunning effects. And – crucially – its native format is SVG.