A better distance transform for Green's method

I have designed a much improved distance transform method suitable for input to Green’s distance map contour texturing method, as presented in the Siggraph course in 2007 and first used by Valve in Team Fortress 2.

My distance transform method has improved speed and accuracy, but most importantly it does not require the input image to be of higher resolution than the final texture. Now it is enough with an alpha map of the same size as the final texture, provided that the alpha map is accurately anti-aliased.
If your contour anti-aliasing is not good enough, you might still want to use a somewhat higher resolution image for the distance transform, but you no longer need silly dimensions of your alpha map to get a good result.

Pending an excruciatingly long review process by the scientific journal I chose for submission of my work, I have now decided to publish the code myself instead of holding up the release of useful software any longer.

Details can be found on:
http://contourtextures.wikidot.com