This program originally appeared in the MSDN Magazine, December 2009.
I took the code there (assumed to be public domain) and polished it a bit to add command-line parameters and a few options. The bulk of the algorithm remains unchanged.
See the comments at the top of Qict.cs for more info.