In: OS WebMaster, Web Graphics Help

SVG… the Era of Scalable (and Programmable) Vector Graphics on the Web

Welcome to WebHelperMagazine.com. Please consider signing up for our RSS feed. Check out our job board, and be sure to leave comments -- we post your name and a link to your site as a way to thank you for joining the WHMag conversation.

by Scott Frangos, Managing Editor - WebHelperMagazine.com
SVG Overview
Scalability without loss of resolution, is definitely an advantage in SVG format images — but did you know that SVG images are also programmable? We’ll take a look at what SVG format means for Web Developers in this article.WebMasters have been living with JPEG, GIF, and then PNG graphic format choices for some time. You might even say these formats are looking alittle “old” in terms of their usefulness. GIF, certainly is. I think most web developers have been aware of EPS (Encapsulated PostScript), and Adobe Corp. proprietary format, for a number of years, but probably don’t use it much online. It has a rep. as a format that is ideal for print. But that could all change — and is changing with the advancing tide of SVG format use. About seven years ago, a new format, similar to EPS (we’ll see how below), called SVG (Scalable Vector Graphics) was created by a group of companies within the W3C — http://www.w3c.org — (World Wide Web Consortium at W3C.org — if you’ve never learned about that group, now would be a good time).

“Synchronized Multimedia Integration Language, another W3C driven technology, may be used to markup timing, layout, animations, visual transitions, and media embedding, and more in SVG artwork.”

SVG’s are similar in format to Adobe’s EPS (both describe shapes as “Vectors”), with some key differences that are destined to become very important for today’s web developers. While most web gurus recognize that “Scalable” means that this type of graphic maintains perfect resolution, no matter how they are scaled (again something print designers really enjoy), many have missed some very important capabilities of this format for the web. You see, SVG’s are programmable, they may be animated, and even may be used as a simple page description language (similar to the Adobe PDF format). The program also includes mobile profiles for those who develop for the mobile phone industry. And of course, this format is “Open Source”, which means that there are no programs to buy, or licensing fees to be paid when developing with it.

Here, we’ll take a look at what all that means for web developers, at how SVG’s may be programmed, and look at a free program you can use to edit SVG’s — InkScape. We’ll also discuss what the future might be for web developers and this new graphic format, which really could be renamed PSVG — Programmable Scalable Vector Graphics. SVG’s feature set includes nested transformations, clipping paths, alpha masks, filter effects, template objects, extensibility and programming of the art created.

But before we proceed, you might be wondering, if SVG is really this great, what’s taking so long for it to explode in web development use? The usual inertia: browser implementation has been slow, and this generation of developers are still primarily comfortable with JPG or GIF/PNG (some have only recently embraced PNG). Many websites that offer SVG format files, also offer the same images in JPG or PNG format, further enabling the inertia. As you come to understand its capabilities, you could also wonder if it will someday eclipse even FLASH.

Comparing SVG to JPG and GIF/PNG

One of the chief strengths of SVG fomat is that it scales with no “pixelization” like you see in the other “raster” based formats. That’s because the image is not described by a map of little square pixels, but instead is described by geometrical coordinates — like CAD formats used in engineering. Below is way to visualize the difference, courtesy of Wikipedia (http://en.wikipedia.org/wiki/Image:Bitmap_VS_SVG.svg):

Bitmap Compared to SVG format
So you can see why “scalability” is emphasized in the name. But what about programming your SVG file. That’s where SVG leaves EPS in the dust, and threatens even to replace FLASH.

How can you program SVG’s? A couple of ways:

  • XML: SVG is an actually an application of XML — it’s a text file, which can be viewed and edited as with any other markup.
  • SMIL: Synchronized Multimedia Integration Language, another W3C driven technology, may be used to markup timing, layout, animations, visual transitions, and media embedding, and more in SVG artwork. You can create slide-show presentations with it, and the SMIL technology may be used to display multiple file types like text, video, and audio.

Here is some a sample of XML code for an SVG image:

SVG XML example
Above you can see how an XML description for an SVG graphic translates into an image (at right). This is courtesy of Wikipedia, which has an excellent article on SVGs you should read at: http://en.wikipedia.org/wiki/Svg.

Try InkScape (free open source program) to create & edit SVG’s

So you’re ready to at least test out the features of SVG’s? Good news — there’s a free, open source program that will help you get a feel for the new format — InkScape (http://inkscape.org).

Download, and install the program, then try creating some simple shapes, as shown below. Then, have a peak at the built in XML editor in the program (also shown below) — it’s available under the Edit Menu.

Inkscape XML Editor
Above is a screenshot from the InkScape program showing some simple shapes and the XML editor open where you can see how the image is described, program in links (bye-bye image maps)… and much more as you become more experienced with the program.

You’ll find extensive documentation, tutorials, and support at the InkScape website, and watch for a series of continuing tutorials here.

I also recommend you hop on over to CrocZilla (http://www.croczilla.com/svg/samples/), and review a list of SVG sample files there… they provide both the visual art file, plus a link so you can view the text code that creates the graphic. Nicely done, by Alex Fritze.

Take a look also at these resources:

Future use of SVG’s…

Ok… what’s going on with this exciting “new” format? If you Google around the web looking at SVG topics, you’ll see there was a lot of excitement about the format approximately two years ago — the CrocZilla example page cited above was posted by Mr. Fritze in 2005. This was around the time that Mozilla implemented it in FireFox Browser 1.5. Since then… the inertia affect seems to holding it back. The SVG project is also mostly a volunteer effort, and so suffers at times from a lack of manpower to upgrade, publicize, and educate users. However, if you use Adobe Illustrator, you will notice that you can save in SVG format, and a number of services for affordable clip art are offering SVG artwork (take a look at Fotolia.com).

What’s the verdict? Well, it all comes down to you, doesn’t it? If you find SVG to be an excellent way to create a graphic rich environment in your web development efforts, then along with other users, your energy will help break the inertia that has dogged its use in recent years. And, rest assured… you’ll be in good company with W3C.org and the Mozilla foundation, among others, all on board and driving forward with you.

About the Author: Scott Frangos is a web developer, college instructor and graphic designer. He is Managing Partner at WebFadds.com, a web development firm specializing in WordPress Content Management Websites. He lives in Portland, Oregon with wife and partner, Pepper, and their three dogs: Wisdom, Spirit, & Steggman.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Netvouz
  • Spurl
  • Facebook
  • SphereIt
  • Sphinn
  • StumbleUpon
  • Technorati
  • BarraPunto
  • SVG... the Era of Scalable (and Programmable) Vector Graphics on the Web blinkbits
  • e-mail
Tags: , , , , , , , , , , , , , , , , , , , , , , , , , ,

Written by: Scott Frangos

This entry was posted on Friday, November 30th, 2007 at 3:37 am and is filed under OS WebMaster, Web Graphics Help. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

6 Responses to “SVG… the Era of Scalable (and Programmable) Vector Graphics on the Web”

  1. stelt said:

    Some things just take time, but as you use the word inertia i think you might have missed a few things.
    Take a look at http://svg.startpagina.nl for a rich spectrum of things SVG is used for (including really new stuff).

    PS: It’s “scalable”, not “scaleable”

  2. Scott Frangos said:

    Hello Stelt - Thanks for your comment and great link. I took a look and saw a very complete resource for all things SVG, including… songs about SVGs. Songs? Wow. I agree with your thought that there are a number of SVG resources out there waiting to be discovered, but the fact that i missed them is exactly my point.

    At a national Technical college, where I work, the curriculum slides for the Web Scripting course still list only JPEGS, PNGs, and GIFS at the standard web graphic formats. This college has schools in 30 states. And just about anyone (not already actively involved with SVG production) that I talk to is unaware of scripting power inherent in SVGs beyond simply the Vector features. So… keep up your good work. - Scott [Ed.]

    PS. Thanks for catching the typo.

  3. LearnToBlog101.com said:

    I followed a link to your article from a forum. Very interesting. I have just recently become competent with .PSD’s, I’m definitely going to look more into SVG’s so I can be on the inside of this new format and not playing catch up like I’ve done on all the other formats. Thanks for the information I look forward to exploring this more.

  4. Scott Frangos said:

    Hi - thanks for stopping by. This is a good time to look at SVG’s… they’ve actually been around for a while, but are just now building up some awareness and momentum. I have taught web graphics for some time, and the standard formats still have a lock hold in most colleges. But everyone loves Flash, at times, and SVG’s are a free, open source alternative with some good free editors (Inkscape) out there. We’ll take a look at your blog — LearnToBlog101.com. - Scott [Ed.]

  5. Vlasta said:

    I do not share you enthusiasm for SVG. Comparing it to raster image formats is unfair and a comparison to flash, which you mention, would be better. I am a software developer and I have read a few things about SVG. It is a bad format. It tries to be all and is nothing. Let’s face it, editing svg as text is nonsense, you’ll always need an editor to create real pictures. There are 10s of ways how to do the same thing, which is useless and only makes the result hard to understand. And, it is extremely difficult to create a stable, solid viewer for SVG - let’s look at Firefox, they have tried to support SVG and they had a lot of time to implement it - it still sucks. The fact that something is free does not make it better, although many people things so…

  6. Scott Frangos said:

    Hello Vlasta -
    Thanks for your comment and perspective on this. I’d wager you are not alone in your criticism of SVGs. I agree that the closest comparison is to Flash, but I think for newbies who don’t know what “Vector” means, that it helps to understand how they are different than raster formats. I don’t agree it is a “bad format.” Sure, you can use an editor to create your pictures — InkScape is one good free example for creating SVGs — and, that’s great… but adding the ability to script and code your images is very powerful. I took a look around at browser support, and found that IE7 does not yet build it in, but Adobe (the Flash people) provide a plugin that does. Interesting. Other browsers all are doing quite well with SVG support (you said FireFox is not… perhaps you have examples of what you mean?). Take a look at this link for what Mozilla has implemented regarding SVGs in Firefox: http://developer.mozilla.org/en/docs/SVG_in_Firefox_1.5 - Scott [Ed.]

Leave a Reply




Message:

Comment moderation is enabled. Your comment may take some time to appear.