SVG, Use it Already
dbushell.com
dbushell.com
I ended up having to use an Illustrator -> Canvas tool (made by Microsoft, oddly), but Canvas is a huge pain when all you want to do is draw some simple shapes. Mobile devices are a huge target for this stuff because of the varying pixel densities, but Android is still mostly a no-go for SVG.
seems wrong - http://developer.android.com/about/dashboards/index.html
"The following pie chart and table is based on the number of Android devices that have accessed Google Play within a 14-day period ending on the data collection date noted below."
As you said the benefits of high pixel densities are visually huge. A small and temporary JS hack is a price worth paying in my opinion.
Oh, sure. But I was talking about just using SVG- for mobile devices with different pixel ratios falling back to raster graphics involves making a number of different size alternatives for each graphic. Not fun.
Scalable graphics as a native web format is a great thing. But if the cost is yet another format filled with irritations and security holes, then no thanks.
The most successful media formats have been very narrowly focused. JPEG, GIF, PNG, MP3s, etc. do not have a zillion exciting features. You can't build a complete web application with a JPEG file. JPEG compresses photographs (and only photographs) really, really well, and that's all it does.
Maybe what scalable vector graphics need to do to catch on is to throw out the super-feature-dense SVG system and come up with something new, something simpler, something that just does scalable still images really well, something that isn't yet another enormous all-singing, all-dancing ball of security liabilities and unintended consequences.
There is no 100%-compatible SVG editor (except notepad) - every vector graphic editor just supports its own subset of SVG, things get lost when transferring things between "SVG-supporting" editors.
There are multiple ways to do the same thing in SVG - this makes it difficult to understand a SVG file created by someone else and it is very hard to return to a complex SVG file after few years and modify it.
The complexity of SVG makes web browsers larger and more complex (hence less secure and slower).
So, I disagree with the article. Keep away from SVG unless you really need it and maybe someone designs a simpler vector format for the web.
I checked out the retina display MacBook Pro at an Apple store the other day and I was happy to see that the SVG on the site rendered at full resolution (at least with Safari).
I think the choice to use SVG for this particular site was a net-win.
Translation: "You just can't" (as in, able, skilled)
To my surprise, it actually works on iOS devices too, except that it doesn't automatically refresh the screen. That is, after zooming it was rendered in a different position than before but not animated. As a hack, I force it to redraw with css animations, continously scaling it slightly (less than 1%).
Reading my comments, it seems ie9 didn't scale svg content according to css sizes, but drew them in "original" size.
Writing the smil animation declarations was pretty much trial by error, didn't find any practical tooling support. I did the original image in inkscape, and then hand edited the xml for the animations. Rotating things was tough, because inkscape didn't leave the element/group centers in any predictable place, so I had to guess good rotation centers.
I wasted about 4 hours on that thing... The result is here: http://173.242.122.166/irmug/local/http/www.irmug.com/ using these logos: http://173.242.122.166/irmug/logo.svg and http://173.242.122.166/irmug/logo.png
This is what I finally decided to do:
1. CSS (for #logo element):
background: url(../../../../logo.png) no-repeat center center;
background: rgba(0,0,0,0) url(../../../../logo.svg) no-repeat center center;
width: 588px;
height: 198px;
(borrowed from https://gist.github.com/1565894 - note two backgrounds!)2. run this stupid script to swap-out logo in Firefox < 4 and IE
window.onload = function() {
if (!document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image", "1.1")) { // IE, Firefox < 4
var el = document.getElementById('logo');
if (el.style.setProperty) {
el.style.setProperty('background-image', 'url("../../../logo.png")', null);
} else { //IE
el.style.backgroundImage = 'url("../../../logo.png")';
}
} else { // just to make sure
var el = document.getElementById('logo');
if (el.style.setProperty)
el.style.setProperty('background-image', 'url("../../../logo.svg")', null);
}
}
It works perfectly on all browsers now, except Opera 11 (when you zoom in, it's all messed up). I can't imagine what the problem could be.If there is a better way of doing it (without using huge libraries), I'd be very thankful if you let me know.
But I'm by no means a web (front end) developer so I'm sure there are better ways to do this; I just didn't feel adventurous enough to spend more than 4 hours on stupid compatibility issues on older browsers :-)
This one will really make your jaw drop (you have to click on different parts): http://upload.wikimedia.org/wikipedia/commons/6/6c/Trajans-C...
Everyone hated java applets 15 years ago.
On Chrome it is about twice the speed but the sliding components return to a position different from where they started.
Slow on a desktop machine translates to nearly unusable on Mobile. On an ICS Android with an Allwinner A10, The slide animation consists of only two frames.
The poor performance is not intrinsic to vector based rendering, SVG is simply not the right tool for that job.
And I completely agree with the last statement. It's cool, but we have better tools in HTML5 for a simple animation like that.
It seems like this would greatly help perceived resolution. With a bitmap, you can't necessarily assume a particular pixel color ordering, and even if you did, with tablets/phones you can't even assume a particular screen orientation. By doing subpixel rendering at view-time, it should be able to give increased resolution in all cases. It would even look best on a printer, which doesn't have separate subpixels (right?).
(Of course, without hinting like fonts have, it could also be worse in some cases.)
You'll need closer to 600dpi in order to not be able to distinguish pixels.
If you still think your ipad/iphone is true retina. Put a single strand of hair on the screen, you'll now be able to see the pixels.
No, it doesn't. No iOS devices use sub-pixel rendering, ever. Unless you mistake it for normal anti-aliasing, which is done on pixel level.
I have less than perfect eyesight. I hold my iPad about 16" away normally. No, I cannot distinguish pixels on the Retina iPad at all. Practically I don't care what is true "retina". For the majority of people, Apple's definition of "retina" is good enough.
Thanks.
If anything, the rest of the industry has to blame itself for delaying so long and investing so little on good displays. Now they have to bite the bullet by competing with each other for the remaining supply of hi-res displays. Would they see this coming a few years ago when Apple invested heavily for such strategic thing?
They've done that in other parts of the supply chain, but I was thinking more about patents. It wouldn't surprise me to find that they've patented how to have a lot of pixels in a particular geometry.
No, I don't mean IE. I mean Photoshop. When every problem looks like a stack of raster layers... well, among other things, vector graphics aren't going to easily come out of that.
OTOH: maybe SVG will help pull us out of the unfortunate accident of history that's meant that Photoshop is used for web layout, but I'd bet we'll see convoluted export procedures before we say a wholesale shift to vector tools....at least, that's the historical pattern.
One that I actually had to fix (and submitted an as yet unacknowledged pull request for) was for arrow-ends: draw a path with an arrow head in blue, then draw one in red and watch every arrow-head on your page turn red.
Here are the 258 open issues in github:
https://github.com/DmitryBaranovskiy/raphael/issues
I'm not trying to bad-mouth other peoples' work; just point out the current state of the project as I've experienced it, for the benefit of others....anyone mind donating one to a poor, deprived Linux PC user? ;)
/ducks
i really believed at that time that SVG (at that time only working (in a sane way) via an Adobe Plugin (yeah, you read right)) would be the future. i wanted to be on the forefront of technology - of A technology - and SVG was my choice. every browser and webgraphics-company pledged support for this amazing new technology! i already saw myself talking at conferences about the amazing new webpages (we still called them pages in 2005) we can build with it.
i think i probably achieved that goal - i was an "interactive SVG" ninja, but nothing came out of it. now i will wait a bit longer how the market turns out before i touch it again. fool me once ...
update: year numbers
Adobe SVG Viewer 6.0 preview 1 was released in July '03 and not updated since.
Can you use a single SVG sprite file that contains all of your SVG images for a single connection/download?
Is there a tutorial for this?
I got this info from somewhere in The Googles, so the information is out there.
I haven't yet tried this on older browsers, so it may need extra help when I decided what browsers my app will support
It runs really great in Chrome + Safari, but Firefox performance is awful.
*edit: grammar
I'm a developer at Mozilla, so I wanted to test your site so I could file an SVG performance bug for Firefox. :)
I see that Firefox 13 is significantly slower than Chrome and Safari, but Firefox 16's Nightly builds are much faster. (Firefox Beta 14 and Aurora 15 are just as slow as 13.)
To my untrained eye, your demo is "only" about 1.5x slower on Firefox Nightly than Chrome and Safari. Is there a way to quantify the speed difference, such as FPS or time to completion? The demo ends at datetime 2012-05-22T00:48:10.
I'd say its a some way off yet, but wouldn't bet against it.