drawImage whole pixels

JavaScript performance comparison

Revision 8 of this test case created

Preparation code

<canvas id="screen"></canvas>
  var ctx = document.getElementById("screen").getContext("2d");
  var image = document.createElement("img");
  image.src = "http://icons.iconarchive.com/icons/ph03nyx/super-mario/48/Retro-Mushroom-1UP-2-icon.png";

Preparation code output

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
whole pixel
ctx.drawImage(image, Math.round(0.5), Math.round(0.5));
sub pixel
ctx.drawImage(image, 0.5, 0.5);

Compare results of other browsers


You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:


Comment form temporarily disabled.

Add a comment