# SuperfastBlur vs StackBoxBlur vs IntegralImageBlur vs StackBlur

## JavaScript performance comparison

Revision 29 of this test case created by

## Preparation code

``````<script src="http://www.quasimondo.com/BoxBlurForCanvas/StackBoxBlur.js" language="javascript"></script>
<script src="http://www.quasimondo.com/BoxBlurForCanvas/FastBlur.js" language="javascript"></script>
<script src="http://www.quasimondo.com/StackBlurForCanvas/StackBlur.js" language="javascript"></script>
<script src="http://www.quasimondo.com/IntegralImageForCanvas/IntegralImage.js" language="javascript"></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
Blurring with StackBoxBlur (1 iteration)
``stackBoxBlurCanvasRGB('canvas', 0, 0, 500, 375, 8, 1);``
pending…
Blurring with SuperfastBlur (1 iteration)
``boxBlurCanvasRGB('canvas', 0, 0, 500, 375, 8, 1);``
pending…
Blurring with StackBlur
``stackBlurCanvasRGB('canvas', 0, 0, 500, 375, 8);``
pending…
Blurring with StackBoxBlur (2 iterations)
``stackBoxBlurCanvasRGB('canvas', 0, 0, 500, 375, 8, 2);``
pending…
Blurring with SuperfastBlur (2 iterations)
``boxBlurCanvasRGB('canvas', 0, 0, 500, 375, 8, 2);``
pending…
Blurring with IntegralImageBlur (1 iteration)
``integralBlurCanvasRGB('canvas', 0, 0, 500, 375, 8, 1);``
pending…
Blurring with IntegralImageBlur (2 iteration)
``integralBlurCanvasRGB('canvas', 0, 0, 500, 375, 8, 2);``
pending…
extremeFractalBlur
``extremeFractalBlur('canvas', 10);``
pending…

## Revisions

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