|
Posted by phil-news-nospam on April 4, 2006, 12:18 am
Please log in for more thread options
Why does SVG need a different tag than other images?
IMHO, SVG should be implemented as an image type just like any other image
type, allowing it to work with <img> tags, and ... here is the important
part ... also work with backgrounds in other tags.
I fail to see any wisdom in making SVG different than say PNG (of course
the implementation of the rendering code would obvious be different).
--
-----------------------------------------------------------------------------
| Phil Howard KA9WGN | http://linuxhomepage.com/ http://ham.org/ |
| (first name) at ipal.net | http://phil.ipal.org/ http://ka9wgn.ham.org/ |
-----------------------------------------------------------------------------
|
|
Posted by VK on April 10, 2006, 3:37 pm
Please log in for more thread options
phil-news-nospam@ipal.net wrote:
> Why does SVG need a different tag than other images?
If you are talking about the same SVG that I'm thinking (Scalable
Vector Graphics) then the answer is simple: because it is not image. It
can be used as scalable vector graphics in its most primitive form, but
mainly it is a scriptable dynamic graphics context you can include into
your page - or vice versa include your entire page *into it*. It is,
roughly speaking, an open source XML based equivalent of Macromedia
Flash.
When used as static graphics, its effectiveness (as opposed to
conventional graphics format) depends on the same factors as for
regular vector vs. bitmap situations. Sometimes vestor graphics is
utterly uneffective (say your family photo represented in besier curves
will probably simply crash any vector rendered). And sometimes bitmaps
are utterly uneffective in comparison to vector transformations.
Say the butterfly
<http://www.croczilla.com/svg/samples/butterfly/butterfly.svg> takes
30.4Kb of text to describe all needed points and vectors. The same
batterfly in PNG format takes 30.7Kb and in JPG 33.4Kb
But the gradient fill
<http://www.croczilla.com/svg/samples/gradients2/gradients2.svg> takes
only 317 bytes to write all SVG commands, while the PNG equivalent
takes 28.3Kb and JPG 15.7Kb
You go figure :-)
If you still think that SVG is just another format for <img>, you may
try to drag the red points at
<http://www.croczilla.com/svg/samples/xbl-shapes2/xbl-shapes2.xml>
Really interesting <img>, is it? :-)
|
|
Posted by VK on April 10, 2006, 5:16 pm
Please log in for more thread options
VK wrote:
> If you still think that SVG is just another format for <img>, you may
> try to drag the red points at
> <http://www.croczilla.com/svg/samples/xbl-shapes2/xbl-shapes2.xml>
>
> Really interesting <img>, is it? :-)
Oh yeh... If you have IE 5.5 or higher, you also may look at the IE's
counterpair: VML (Vector Markup Language).
At this page:
<http://www.geocities.com/schools_ring/archives/VML_SVG.html> click
anywhere on canvas to define lines.
Should it be another extension for poor <img>? ;-)
|
|
Posted by phil-news-nospam on April 12, 2006, 3:39 pm
Please log in for more thread options
| phil-news-nospam@ipal.net wrote:
|> Why does SVG need a different tag than other images?
|
| If you are talking about the same SVG that I'm thinking (Scalable
| Vector Graphics) then the answer is simple: because it is not image. It
| can be used as scalable vector graphics in its most primitive form, but
| mainly it is a scriptable dynamic graphics context you can include into
| your page - or vice versa include your entire page *into it*. It is,
| roughly speaking, an open source XML based equivalent of Macromedia
| Flash.
We're arguing semantics here. But I think that's an argument that needs
to be carried out. SVG is very usable as an image. It can function as
an image. Pass the octet stream received from the HTTP server to the code
that is an implementation for it, and get back a pixel array that can be
given to the GUI subsystem to display on the current page. This can be
with GIF, JPEG, PNG, etc ... so why not SVG.
Even Flash could be done this way. But it also takes over mouse control
so it needs something more. But still, it could at least be displayed
that way, if the implementations generalized things well enough.
| When used as static graphics, its effectiveness (as opposed to
| conventional graphics format) depends on the same factors as for
| regular vector vs. bitmap situations. Sometimes vestor graphics is
| utterly uneffective (say your family photo represented in besier curves
| will probably simply crash any vector rendered). And sometimes bitmaps
| are utterly uneffective in comparison to vector transformations.
|
| Say the butterfly
| <http://www.croczilla.com/svg/samples/butterfly/butterfly.svg> takes
| 30.4Kb of text to describe all needed points and vectors. The same
| batterfly in PNG format takes 30.7Kb and in JPG 33.4Kb
|
| But the gradient fill
| <http://www.croczilla.com/svg/samples/gradients2/gradients2.svg> takes
| only 317 bytes to write all SVG commands, while the PNG equivalent
| takes 28.3Kb and JPG 15.7Kb
|
| You go figure :-)
We don't dismiss PNG from <img> just because there are some cases that
PNG is not optimal for. Why should we do so for SVG?
| If you still think that SVG is just another format for <img>, you may
| try to drag the red points at
| <http://www.croczilla.com/svg/samples/xbl-shapes2/xbl-shapes2.xml> |
| Really interesting <img>, is it? :-)
Certainly SVG is a lot more than just showing an image. But that should
not rule out doing so.
As it turns out, I'm more recently told that the standards do not rule out
SVG in <img>. Perhaps it is a mis-read or mis-understanding of the standards
on the part of Firefox developers, or maybe it is an excuse given by them
because they have a poor graphical infrastructure that cannot easily handle
SVG in the same way it handles PNG.
I notice that Firefox creates a frame for SVG with <object> but does not do
so for PNG with <object>. That may be telling about how they do internals.
--
-----------------------------------------------------------------------------
| Phil Howard KA9WGN | http://linuxhomepage.com/ http://ham.org/ |
| (first name) at ipal.net | http://phil.ipal.org/ http://ka9wgn.ham.org/ |
-----------------------------------------------------------------------------
|
|
Posted by VK on April 12, 2006, 4:44 pm
Please log in for more thread options
phil-news-nospam@ipal.net wrote:
> Pass the octet stream received from the HTTP server to the code
> that is an implementation for it, and get back a pixel array that can be
> given to the GUI subsystem to display on the current page. This can be
> with GIF, JPEG, PNG, etc ... so why not SVG.
Because SVG has nothing to do with the above described mechanics.
Sorry, but you seem to demonstrate some missing knowledge on the
subject. SVG is a set of textual command arranged into XML syntacs. Say
this is a right targeted arrow image:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
"http://www.w3.org/TR/2001/REC-SVG-20050904/DTD/svg10.dtd"> <svg xmlns="http://www.w3.org/2000/svg" version="1.0">
<title>No title</title>
<polygon
points="159,0 209,51 159,100 159,55 103,55 58,101 0,101
50,51 0,0 58,0 103,45 159,45"/>
</svg>
It can be viewed as it is (as am .xml or .svg document) on a browser
with SVG support like Firefox 1.5 or higher or Opera 7.0 or higher.
It can be added directly to the document DOM tree using
document.createElementNS (NS- because as you can see SVG doesn't share
the default "HTML" namespace, it has its own). You don't need any
<object> wrapper for it.
I'm failing to see any sorrelation between *this* and a binary stream
for <img>
If we take your above quoted statement in the most wide sense, then it
gets too general to be usable. With the same effect we could apply it
then to HTML itself and ask <img> to support direct HTML code
insertion.
Because it is too an octet stream from the server (HTML source code in
TCP/IP packets) sent to an implementation for it (HTML parser) to get
back a pixel array (graphics context produced in the browser window).
You have to be careful with semantic - it may bite ;-)
|
| Similar Threads | Posted | | images won't appear in IE | January 3, 2005, 8:40 pm |
| two images i corners | December 11, 2004, 4:04 pm |
| Background images | January 25, 2005, 5:19 pm |
| Horizontal row of images... | June 20, 2005, 10:04 am |
| Using Icons As Images | June 30, 2005, 9:14 am |
| CSS Floats Images and IE (Help please!) | September 4, 2005, 6:55 am |
| Can I specify that some images load before others? | December 1, 2005, 6:41 am |
| inline images | December 27, 2005, 2:48 am |
| How do I Superimpose 2 images ? | July 18, 2005, 5:14 pm |
| How are images best set as background? | August 26, 2006, 10:12 pm |
|