Pixel manipulation performance
Use diagonals. The idea is to have only one pixel check, compared to two you have now: 


find the first occupied pixel on a diagonal
skip to an unoccupied one
fill with 0.1 while unoccupied
repeat 1-3 until out of bounds


Considering everything should be inlined, the code would be like this:

var x, y, index, index0,
    len = width * height * 4,
    stride = width * 4;
    strideDia = stride + 4; // distance to the sibling pixel towards bottom-right


    

// walk diagonals from the bottom-left corner to the top-left corner
for (x = 0, y = height, index0 = (y * width + x)*4 + 3; --y &gt;= 0; ) {
    index = index0 -= stride;

    while (index &lt; len &amp;&amp; x &lt; width) {
        // find an occupied pixel
        while (index &lt; len &amp;&amp; x &lt; width &amp;&amp; !data[index])
            index += strideDia, x++;
        // skip to an unoccupied
        while (index &lt; len &amp;&amp; x &lt; width &amp;&amp; data[index])
            index += strideDia, x++;
        // fill with 0.1 all unoccupied
        while (index &lt; len &amp;&amp; x &lt; width &amp;&amp; !data[index]) {
            data[index] = 25; // 0.1 * 256
            index += strideDia;
            x++;
        }
    }

    x = 0;
}




// walk diagonals from the top-left corner to the top-right corner
// (0,0) is skipped as it was processed in the previous walk block
for (x = 0, y = 0, index0 = (y * width + x)*4 + 3; ++x &lt; width; ) {
    index = index0 += 4;
    var x0 = x;

    while (index &lt; len &amp;&amp; x &lt; width) {
        // find an occupied pixel
        while (index &lt; len &amp;&amp; x &lt; width &amp;&amp; !data[index])
            index += strideDia, x++;
        // skip to an unoccupied
        while (index &lt; len &amp;&amp; x &lt; width &amp;&amp; data[index])
            index += strideDia, x++;
        // fill with 0.1 all unoccupied
        while (index &lt; len &amp;&amp; x &lt; width &amp;&amp; !data[index]) {
            data[index] = 25; // 0.1 * 256
            index += strideDia;
            x++;
        }
    }

    x = x0;
}


Another potentially promising idea would be to use asm.js.