SuperfastBlur vs StackBoxBlur vs IntegralImageBlur vs StackBlur

JavaScript performance comparison

Revision 31 of this test case created by Aleksandar Ružičić

Preparation code

<script src="https://raw.githubusercontent.com/Quasimondo/QuasimondoJS/master/blur/StackBoxBlur.js"></script>
<script src="https://raw.githubusercontent.com/Quasimondo/QuasimondoJS/master/blur/FastBlur.js"></script>
<script src="https://raw.githubusercontent.com/Quasimondo/QuasimondoJS/master/blur/StackBlur.js"></script>
<script src="https://raw.githubusercontent.com/Quasimondo/QuasimondoJS/master/blur/CompoundBlur.js"></script>
<script src="https://raw.githubusercontent.com/Quasimondo/QuasimondoJS/master/blur/IntegralImage.js"></script>
<div id="canvasHolder" style="position:absolute;left:20px; top:20px;text-align:center;font-size:10px;">
<script>
function extremeFractalBlur(id, iterations) {
  var a = document.getElementById(id);
  var aCtx = a.getContext('2d');

  var x = 0;
  var y = 0;    
  aCtx.globalAlpha = 1 / 2;
  for (var i = 0; i < iterations; ++i) {
    var direction = i % 4;
    var offset = i * 2 + 1;
    switch (direction) {
      case 0:  // Up.
        y -= offset;
        break;
      case 1:  // Right.
        x += offset;
        break;
      case 2:  // Down.
        y += offset;
        break;
      case 3:  // Left.
        x -= offset;
        break;
    }
    aCtx.drawImage(a, x, y);
  }
}
</script>
<canvas height="375" width="500" style="width: 500px; height: 375px;" id="canvas">
</canvas></div>
    

Preparation code output

<div id="canvasHolder" style="position:absolute;left:20px; top:20px;text-align:center;font-size:10px;"> <canvas height="375" width="500" style="width: 500px; height: 375px;" id="canvas"> </canvas></div>

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
compundBlurCanvas
compundBlurCanvasRGB('canvas', 0, 0, 500, 375, 8, 2, 2, 4)
pending…

Revisions

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

0 Comments