I'm Aza Raskin @aza. I make shiny things. I simplify.

I'm VP at Jawbone, focusing on health.

 

Cross Browser Canvas Support & Speed

It used to be that if you wanted to draw—curves, shapes, and polyhedra—with Javascript, you would have been out of luck. However, almost all modern browsers now supportcanvas, which is a nifty technology that finally lets Javascript out of its DOMy prison.

For the most part it works well. To see it in action, take a look at the always-excellent John Resig’s Processing.js, Ilmari Heikkinen’s CAKE, and my own Algorithm Ink (which I’ll write more about soon).

Standards Compliance

In the grand tradition of browser technologies, Canvas isn’t fully supported by everyone, yet.

Firefox 3 and Opera 9.5 both get good marks. Ironically, it’s Apple—who originated the technology—that hasn’t gotten around to implementing some of the basics. In particular, Safari isn’t yet standards compliant and doesn’t implement the fundamental setTransform and transform. Transform is, however, supported in the the nightly build of Webkit.

IE is the only browser that doesn’t support Canvas at all (although, with Google’s excanvas you can pretend that it does).

To see exactly how well your favorite browser does, head over to the test report generator. Do note some of the tests are fairly pedantic and don’t have much real-world meaning. To see how your browser stacks up against other browsers, go here. The same caveat still applies here as well, so take them with a grain of a salt.

Speed Tests

In general, Safari is always the fastest, followed closely by Firefox (in most cases), with Opera lagging in far third. Excanvas-enabled IE wasn’t really aware that the race had started. In general, it looks like what slows Firefox down is stroked arcs, while for Opera it’s filled arcs.

You can find the code for the tests here. I averaged the render times over 10,000 draws

Excanvas-enabled IE uses VML under the hood, so every object you draw remains as a live, unrasterized object that eats memory and potentially CPU time. This means that I wasn’t able to test IE in the same way I tested the other browsers: making 10,000 smiley faces causes IE to collapse into an unresponsive mess and die (IE can’t handle all the happiness?).

You can also see how the time increases as more and more objects are added in IE: Drawing 100 circles took only 1.1ms per circle, drawing 10000 circles took 2.14ms per circle, and drawing 50000 took a whopping 21.77ms per circle.

RT @aza Cross Browser Canvas Support & Speed | Follow @aza on Twitter | All blog posts

View all 101 comments



Michael

Canvas is, in my opinion, the most exciting feature to hit the web, ever. I’m really surprised it’s still somewhat obscure among developers, but that might be the IE factor.

I’m using Canvas to make a small physics based game. You don’t get great performance yet, but I really feel Canvas could replace Flash for simple web games some day.


Safari certainly does implement transform() (but not setTransform yet). I think just about anything you can do with setTransform() can be done with transform() possibly combined with saving and restoring the context.



Blair McBride

Now all we need is some standardized text rendering API – I think Firefox 3 is the only one to have this so far.



Exec

Nice, really looking forward to more hardware accelerated canvas in “true” 3D :D

@Michael
Have you seen these canvas games and apps yet?
Processed tower defense ( http://ptdef.com/ )
Four games from Nihilogic ( http://www.nihilogic.dk/labs/javascript-games/ )
ImageFX ( http://www.nihilogic.dk/labs/imagefx/ )
Processing.js ( http://ejohn.org/blog/processingjs/ )


Give it some time. It’s new. Besides, Opera is so much better than FF or Safari in so many ways. That’s just my opinion, of course.



Aza Raskin

@Maciej: Thanks for catching that. I’ve updated the blog post accordingly (*looks sheepish*).

@Exec: I’m looking forward to hardware accelerated 2D, more than 3D ;)


Huh, I don’t see that here. Reported speed is similar between Firefox 3 and Opera 9.50; Firefox was actually a bit slower at some of the tests.

Additionally, Firefox likes popping up warnings that the JS “may have stopped responding”, and indeed it’s generally unusable while the benchmark’s running; even opening a new empty tab takes many seconds. On the other hand, my 104-tab (ahem) Opera session remains responsive.


CANVAS is formally supported in the working draft for HTML 5. Hopefully in a few years it will be a standard and cross-browser implemented (basically means getting IE to support it…)


“Give it some time. It’s new. Besides, Opera is so much better than FF or Safari in so many ways. That’s just my opinion, of course.”

Hey! I made that exact comment on reddit…


Nice work Aza!

One of the more fun Canvas applications I’ve come across recently is Philip Lenssen’s “Bomomo”:

http://bomomo.com/



Aza Raskin

@Thomas: Interesting. I wonder why we see this discrepancy? I have been testing on a MacBook Air, with OS X 10.5. How about you?


I’m surprised that nobody’s brought up SVG yet! SVG is so much awesome-r than canvas tags, I can’t begin to express it.

Y’all should play with it some time, it’s at least mostly supported in all modern browsers.



funtomas

How about support for c3DL in Firefox? Is it slated?



Philip Taylor

Blair: A standardised text rendering API was added to the specification recently – http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas.html#text

(Firefox 3 has a non-standard Mozilla-specific API, which was done before this part of the spec was written.)

Nobody has implemented this yet, but hopefully it will be in the next one or two rounds of browser releases.



Michael

@Exec: Some of those are new to me, thanks for the links.



an0n1 m0us

I just want to know one thing. If we use Google’s excanvas for IE, can we finally do the equivalent of rounded corners (border-radius) across Fx3 and IE6/7/8 **now**? As in today?


Aza: This is on a Windows XP system with a dual core Opteron. I think OS X is lacking PGO optimized builds, which probably accounts for at least part of it.

Also, perhaps their drawing optimizations weren’t as effective on OS X: http://my.opera.com/desktopteam/blog/2008/03/28/painting-performance-fixes



Aza Raskin

@Thomas: Thanks for the feedback. I had no idea there would be so much variation across operating systems.

@Maciej: It appears that Safari 3.0.4 indeed doesn’t support transform. The nightly, however, does.


@Aza: I believe .transform was added to WebKit prior to the most recent release of Safari, Safari 3.1.



Rob

In tests that I’ve run, Firefox 3 and Opera 9.5 split the number two and three spots rather evenly, while Safari 3.1 for Windows was typically 2-3x faster.

Opera 9.5 and Firefox 3 both took about 280 µs to draw a filled circle, Safari 3.1 took 115 µs. While this difference may seem huge, it really isn’t. There’s nothing I’ve ever toyed around with that was completely do-able in Safari but would have been too slow in Opera or Firefox.



Philip

Hi, Aza. Very interesting.

Unfortunately I had trouble seeing the graphs because they were in Flash. JPG or PNG images make life easeir for weaker processors and users who avoid proprietary software. And if you have to use Flash, version 7 works better for those users.

Thanks and keep up the excellent work!



Aza

@Rob: Thanks for the extra data points. I agree with you that these speed results are a bit pedantic. Interesting, though.

@Phillip: I feel a little ashamed that I used Flash for my graphs. I really should have used Canvas ;)



Rick

Excanvas works for IE8 beta?


gkcihqgwcfrwokksvdlirktcnqzmzk


i agree opera is way better than firefox. firefox doesnt memmorize your tabs after u close the browser but opera does. firefox sux


Thank you very much for testing all this feature, I am currently working on cross-browser animations so this is very useful to me !



Mitur Binesderti

It seems odd that you don’t bother to mention Google’s Chrome. There’s no date on this article but you’re talking about Opera 9.5 and it’s up to 10.6 now so maybe this was written way before it even existed.


Safari certainly does implement transform() (but not setTransform yet). I think just about anything you can do with setTransform() can be done with transform() possibly combined with saving and restoring the context.


Canvas is, in my opinion, the most exciting feature to hit the web, ever. I’m really surprised it’s still somewhat obscure among developers, but that might be the IE factor.



Sex

Canvas is, in my opinion, the most exciting feature to hit the web, ever. I’m really surprised it’s still somewhat obscure among developers, but that might be the IE factor.


The basis of its investigation indicates that mens belts they operate cheap gucci belts on a sustainable path cheap louis vuitton belts for men of poverty, cheap desiger belts job security gucci belts on sale and low wages. The Department louis vuitton belts cheap for Work and Pensions, said, with five billion people return to work undertaken. The charity said that about one-fifth of the poverty and again and again where people escape from poverty on a temporary basis.


I think that’s a pretty neat idea. My current watch is a Timex that mimics a chronograph digitally but has both an analog and digital face: I can hide the digital part of it by pressing a button and leave the clean lines of a analog watch (which I prefer). Since I enjoy the benefits of digital for cycling and training and such, it’s nice to have that option.



sex

For the most part it works well. To see it in action, take a look at the always-excellent John Resig’s Processing.js, Ilmari Heikkinen’s CAKE, and my own Algorithm Ink (which I’ll write more about soon).


thnks
goooooooooooood
min:)


Your article is good. I learned a lot from this. Keep up the good work.


Pingback from koreyweldon.wordpress.com

HTC breaks its own sales and profit records, keeps riding the smartphone wave to success | koreyweldon


That was a really joy of a blog…


My canvas is mine

website [code] ought not be [en]able[d] to wield MY canvas against me... to detect use of surfer side code manipulation.

how I use content in the PUBLIC SPHERE is my call alone. Don't like that? Don't place content in the PUBLIC sphere!

duh?


thnks
goooooooooooood
min:)ااا


I’m just writing to let you be aware of what a incredible experience my cousin’s girl enjoyed checking the blog. She learned a good number of things, which include what it is like to have a very effective teaching mood to make many people without hassle completely grasp specified complicated matters. You actually surpassed people’s expected results. Thanks for producing the interesting, trustworthy, revealing and even fun thoughts on that topic to Emily.



jay

It would be really helpful if this page had dates for replies and comments. IE is supporting canvas pretty heavily, and the other browsers have improved as well. This seems like old info.


article is very nice and unique. thank you. Artikel kesehatan cari tahu tentang Cara mengobati cacar air


Hello there! I know this is kinda off topic but I was wondering which blog platform are you using for this site? I’m getting tired of WordPress because I’ve had issues with hackers and I’m looking at alternatives for another platform. I would be fantastic if you could point me in the direction of a good platform.


Hi there! I could have sworn I’ve been to this website before but after reading through some of the post I realized it’s new to me. Nonetheless, I’m definitely delighted I found it and I’ll be bookmarking and checking back often!


Merely need to state your own post is really as amazing. The actual lucidity inside your set up is merely good as well as i will assume you are educated with this topic.


I have found precisely what I am just seeking in the posting. My spouse and i appreciated this kind of a whole lot


I have been absent for a while, but now I remember why I used to love this website. Thanks, I’ll try and check back more often. How frequently do you update your website?


Keep em coming. you all do such a great job at such Concepts. can t tell you how much I, for one appreciate all you do!


Hi webmaster, commenters and everybody else !!! The blog was absolutely fantastic! Lots of great information and inspiration, both of which we all need!b Keep em coming. you all do such a great job at such Concepts. can t tell you how much I, for one appreciate all you do!


Have you ever considered adding more videos to your blog posts to keep the readers more entertained? I mean I just read through the entire article of yours and it was quite good but since I m more of a visual learner,I found that to be more helpful well let me know how it turns out! I love what you guys are always up too. Such clever work and reporting! Keep up the great works guys I have added you guys to my blogroll. This is a great article thanks for sharing this informative information. . I will visit your blog regularly for some latest post.


Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I ll be subscribing to your feed and I hope you post again soon.


That fantabulous post this has been. Within no way seen this kind associated with useful post. I am grateful to you and anticipate much more associated with posts such as. Thank you very much.


The post is pretty interesting. I really never thought I could have a good read by this time until I found out this site. I am grateful for the information given. your writing is also very excellent. Thanks for nice post. From the tons of comments on your articles, I guess I am not the only one having all the enjoyment here! keep up the good work.


Interesting topic for a blog. I have been searching the Internet for fun and came upon your website. Fabulous post. Thanks a ton for sharing your knowledge! It is great to see that some people still put in an effort into managing their websites. I ll be sure


Just what I needed. Thankyou I have been looking for this sort of information for ever. I have made note of your blog in order for me to read more on the topic.


I must tell you I am impressed. Very seldom do I encounter a blog that s both educative and entertaining. Just want to let you know that you have most definatly hit the nail on the head. Your thought is excellent. Thx is all I can say .


A powerful share, I just given this onto a colleague who was doing a little analysis on this. And he actually bought me breakfast as a result of I discovered it for him. . smile. So let me reword that: Thnx for the deal with! But yeah Thnkx for spending the time to discuss this, I feel strongly about it and love studying more on this topic. If attainable, as you turn into expertise, would you mind updating your weblog with extra particulars? It s highly helpful for me. Big thumb up for this blog put up!


I actually learned about nearly all of this, but with that in mind, I think it is still useful. Great job!


Hello I found your blog by mistake when i was searching AOL for this matter, I must tell you your blog is actually useful I also adore the design, which is cool that!


With the whole thing that seems to be developing within subjects, all of your scenes are generally quite refreshing. Even so, I apologize, but I can not subscribe to your entire plan, all be it exhilarating none the less. It seems everyone your opinions are generally not completely Justified and in reality you are generally yourself not really fully convinced of the argument. In any case I do not appreciate a look.


I see you put a lot of work on this site! Keep writing!


Although I am not a noob in the website industry, your site is truly unique and features some useful insights. Enjoy it fully! I, ll have entered my blogroll, I think it will give more value to the visitor.


An interesting dialogue is worth comment. I feel that you should write extra on this topic, it won, Aot be a taboo subject but usually people are not enough to speak on such topics. To the next. Hail


I was imprssed with the quality of the information on this website. There are many great resources here. I am sure I will visit this place soon.


This is a great resource that you are providing and you give it away for free. I enjoy seeing websites that understand the value of providing a major resource for free. I really loved reading your post. Thank you!


Super blog post, I count on updates by you.


I was very encouraged to find this site. I want to thank you for this special read. I definitely enjoyed every bit of it and I have you bookmarked to check out new stuff you post.


I admire the valuable information you offer in your articles. I will bookmark your blog and my children check here often. I am quite sure they will learn lots of new things here than anyone else!


Finally, an issue that I want. I have searched for information of this caliber for the last several hours. Your site is greatly appreciated.


Thank you for another essential article. Where else could one get this kind of information in such a complete way to write? I have a presentation next week, and I am on the look for such information.


This is the perfect blog for anyone who wants to know about this topic. You know so much it s almost hard to argue with you (not that I really want . HaHa). You definitely put a new spin on a topic that has been written about for years. Great stuff, just great!


This is a smart blog. I really do. You have so much knowledge about this issue, and so much passion. You also know how to make people rally behind it, obviously from the responses. You have a design here that is not too flashy, but makes a statement as big as what you say. Great job, in fact.


This is my first time i visit here. I found so many entertaining stuff in your blog, especially its discussion. From the tons of comments on your articles, I guess I m not the only one having all the enjoyment here! Keep up the good work.


Simple, wonderful what you ve done here. It is pleasing to look you express from the center and your clarity on this significant content can be easily viewed. Extraordinary items and expect your future updates.


Aw, this was a post that was really good. In theory I d like to write like this too taking time and real effort to make a good article . but what can I say . I procrastinate a lot and never seem to get something done that.


Far, this post is really sweet about this important topic. I am in harmony with the conclusions and are greedily looking forward to the update entry. Saying thank you will not just be sufficient, for the wonderful clarity in your writing. I will immediately grab your rss feed to stay informed of any updates. Wonderful work and much success in your business dealings! Please excuse my poor English as it is not my first language.


Let me start by saying beautiful post. Im not sure if this has been discussed about, but when using Chrome I can never get the entire site to load without refreshing many times. It may be my computer. Thank you.


I can see that you put a lot of effort into your blog. Keep posting the good work. Some really helpful information in there. Bookmark. Nice to see your site. Thank you!


Great stuff from you, man. Ive read your stuff before and youre too magnificent. I love what you ve got here, love what you say and how you say it. You make it entertaining and you still can stay smart. I can not wait to read more from you. This is really a great blog.


Not? T better written. Reading this post reminds me of my old room mate! He was always talking about it. I will forward this article to him. Pretty sure he will have a good read. Thank you for sharing!


Resources like the one you mentioned here will be very useful to me! I will post a link to this page on my blog. I am sure my visitors will find that the most useful.


I thought it was going to be some boring old post, but it really compensated for my time. I will post a link to this page on my blog. I am sure my visitors will find that the most useful


Great post! I m just starting out in the media community management marketing and trying to learn how to do it well resources like this article useful. As our company is based in the U. S. , it? S all a bit new to us. The example above is something that I worry about as well, how to show your own enthusiasm and share the fact that your product is useful in this regard


Hrmm that s weird, my comment got eaten. Still I would say that it is great to know that someone else also mentioned this as I have trouble finding the same information elsewhere. This was the first place that told me the answer. Thank you.


Hey, just looking around some blogs, seems a pretty good platform you are using. I m currently using WordPress for some of my sites but looking to change one of them to a platform similar to yours as a trial. Anything in particular you would recommend about it?


You got a really useful blog I have here reading for about an hour. I am a newbie and your success is very much an inspiration for me.


This article gives the light in which we can observe the reality. This is very nice one and gives in depth information. Thank you for this beautiful article


“%KW%”


You may have not intended to do so, but Ia think you have managed to express the state of mind that a lot of people are in. The sense of wanting to help, but not knowing how or where, is something a lot of us are going through.


Keep em coming . you all do a great job at such concepts . can not tell you how much I, for one appreciate all you do!


Thank you for taking the time to discuss this, I feel strongly about it and love learning more on this topic. If possible, as you gain expertise, would you mind taking updating your blog with more information? It is extremely useful for me.


This is a really good read for me, Must aadmit that you are one of the best bloggers I ever saw. Thanks for posting this informative article.


Hey, just looking around some blogs, seaems a pretty nice platform you are using. I m currently using WordPress for a few of my sites but looking to change one of them over to a platform similar to yours as a trial run. Anything in particular you would recommend about it?


“%KW%”


Great post! I?m just starting out ina community management marketing media and trying to learn how to do it well resources like this article are incredibly helpful. As our company is based in the US, it?s all a bit new to us. The example above is something that I worry about as well, how to show your own genuine enthusiasm and share the fact that your product is useful in that case


I thought it was going to be some baoring old post, but it really compensated for my time. I will post a link to this page on my blog. I am sure my visitors will find that very useful


Resources like the one you mentionaed here will be very useful to me! I will post a link to this page on my blog. I am sure my visitors will find that very useful.


I’d like to amicable an account Sunny Lolitas U every one articulate this dude has minor dick… Seems that u have each and every one elder giant cocktatrones by which even lex steele would sat WUT?.. Cmon.. dont bullshit.. Partially of us here are teenagers which merely wank, as well as me ofc.. new half is well how to put it.. I dont ponder they have nor substantial dicks nor they fuck a lot.. obviously


Leave a Comment