[standards-jig] Jabber Icons (JEP-0038)

Iain Shigeoka iain.shigeoka at messaginglogic.com
Fri Jul 19 20:30:07 UTC 2002


On 7/19/02 10:02 AM, "Adam Theo" <theo at theoretic.com> wrote:

> Iain, I have heard that SVG is pretty verbose and overkill for small
> icon-sized graphics, unless you really want the transparency and
> animation features. Is this true? what are file size comparisons
> (uncompressed) between rastor formats like PNG, JPG, and GIF; and the
> vector format of SVG? I think this will be the deciding issue for me.

It can be in the same way that anything XML can get verbose.  The trick for
efficiency is to exploit its vector nature, and rely on built in shapes, and
allow fonts to be rendered at the client.  The verbose SVG files tend to
actually draw each piece of text as a series of complex lines, include a lot
of embedded raster images, and don't make use of the built in shapes.

This is a complete SVG drawing:

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE svg
  PUBLIC "-//W3C//DTD SVG 20001102//EN"
 "http://www.w3.org/TR/2000/CR-SVG-20001102/DTD/svg-20001102.dtd">
<svg xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root"
     width="100%" height="100%" viewBox="0 0 100 50">
   <title>Custard SVG</title>
   <desc>Hey this is a really goofy picture of a box and text.
         Note that his description can actually dominate the image file size
         and has absolutely nothing to do with the image itself.</desc>
   <rect x="5" y="10" width="90" height="40"
         style="fill:none; stroke:black;  stroke- width:1"/>
   <text class="mi1" x="20" y="30" font-size="10" fill="black">hello</text>
   <text class="mi2" x="45" y="35" font-size="5" fill="red">world</text>
   <defs> 
      <style type="text/css"><![CDATA[
          .mi1{ font-family: 'Courier New', monospace; font-style: italic }
          .mi2{ font-family: 'Arial Black' }
          ]]>
      </style>
   </defs>
</svg>

Save it to a text file named something.svg and then hit it with a web
browser that has the adobe SVG plug-in installed (or use any of the other
SVG viewers).  Is this verbose?  I don't know.  If you make your rendering
with the box at 5x5 pixels, it sure is compared to the equivalent raster
file (probably *.bmp).  If you make your rendering at 200x200 pixels its
pretty compact.

Something to note though, you can go into this "image" and add all sorts of
very useful meta-data.  The possibilities for Jabber applications are
exciting.  For example, we could define a standard optional meta-data in
Jabber SVG emoticons that include sound (creative sound fonts?), or could
have information that lets it be turned to a spoken equivalent for voice
interfaces, etc etc.

Second, like Jabber's highly inefficient XML protocol, there are significant
advantages to SVG's XML nature.  For example, I bet you could edit this
image to change the color of the word hello, and change the text "world" to
"Adam".  Do you need a special SVG editor?  It may help.  But do you really
need it?  Bah, humbug.  Pop open vi and edit away.  Add a circle.  You could
probably do it by a 15 second look at the SVG standard and vi.

Third, now its probably easy to see the power of SVG just like the Jabber
protocols.  Who can take this simple example and figure out a
perl/python/you-name-it script to dynamically generate SVG from all sorts of
interesting data? 

Can you imagine what your client can do if it understands XML?  How about
seeing that it is not animated, going into the DOM, inserting some simple
triggered animations to make the icon jump or jiggle.  Then every time a
message comes in from some one and it mentions the magic word, the client
triggers the action and the icons jiggle...  :)  Avatars will probably find
this a great tool but some thing fun might be had with emoticons too.

Are we excited yet?  :)

I know I sure got excited once I started really digging into SVG.   Makes it
real hard to go back to something like PNG and even contemplate the amount
of infrastructure you need to do the really fun stuff (anything beyond just
showing the image).

-iain




More information about the Standards mailing list