drawImage whole pixels

JavaScript performance comparison

Revision 14 of this test case created by ryan jacobson

Preparation code

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

Preparation code output

<canvas id="screen"></canvas>

Test runner

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

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
whole pixel
ctx.drawImage(image, (0.5 | 0), (0.5 | 0));
pending…
sub pixel
ctx.drawImage(image, 0.5, 0.5);
pending…

Compare results of other browsers

Revisions

You can edit these tests or add even more tests to this page by appending /edit to the URL.

0 Comments