haxelib install pixel-sprite-generator
The sprites are generated by using a two dimensional mask. The values in the mask are then randomized and mirrored. The resulting template is rendered to a canvas element.
The algorithm is explained in more detail on Dave Bollinger's website.