a JavaScript implementation of the pixel sort algorithem