1

if i draw my images in different canvas can i apply some effects like fades, movements and other effects with a js library? and if is possible, could be interesting in terms of speed and performances instead of manipulating the "raw" ? thanks a lot

Luke
  • 2,976
  • 6
  • 34
  • 44

1 Answers1

2

if i draw my images in different canvas can i apply some effects like fades, movements and other effects with a js library?

Yes, you can. You don't need a library.

and if is possible, could be interesting in terms of speed and performances instead of manipulating the "raw" ?

Canvas would be faster as it doesn't involve going through the DOM and setting CSS properties, as you would if you manipulate images without canvas.

Delan Azabani
  • 79,602
  • 28
  • 170
  • 210
  • so, in you opinion, in a "one-page" site would be better to draw all images in some canvas and then work with them? – Luke Mar 01 '11 at 10:06
  • I'm not sure what you mean by "'one-page' site", sorry. – Delan Azabani Mar 01 '11 at 10:06
  • no problem man, i was just referring to a website with only a page and a menu which point to some anchors on the page and scroll to them :) – Luke Mar 01 '11 at 10:09
  • I cannot agree with your blanket statement that it _"would be faster as it doesn't involve going through the DOM and setting CSS properties"_. Although not specifically the effects described in the question, see [these tests](http://phrogz.net/tmp/image_move_speed.html) from [this answer](http://stackoverflow.com/questions/4842872/performance-of-moving-image-on-web-page-via-css-vs-html5-canvas/4846077#4846077) proving that when it comes to moving and compositing images, using HTML and CSS performs better than trying to composite and blit things yourself. And it's easier, too, IMO. – Phrogz Mar 02 '11 at 00:11