Canvas Image

Benchmark created by Daniel Baulig (Ba. Thesis) on


Preparation HTML

<canvas width="800" height="600" id="canvas"></canvas>
<script>
  var canvas = document.getElementById('canvas');
  var context = canvas.getContext('2d');
  var images = [new Image(), new Image(), new Image(), new Image()];
  var w = canvas.width,
      h = canvas.height;
  
  images[0].src = 'http://www.w3.org/html/logo/downloads/HTML5_Badge_512.png';
  images[1].src = 'http://www.w3.org/html/logo/downloads/HTML5_Badge_128.png';
  images[2].src = 'http://www.w3.org/html/logo/downloads/HTML5_Badge_32.png';
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Large Image
context.drawImage(images[0], 0, 0);
ready
Medium Image
context.drawImage(images[1], 0, 0);
ready
Small Image
context.drawImage(images[2], 0, 0);
ready

Revisions

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

  • Revision 1: published by Daniel Baulig (Ba. Thesis) on
  • Revision 3: published on