I came across the work of Petros Vrellis via the 2016 hackaday.com post "Computer-Designed Portraits, Knit by Hand" I was instantly drawn to the hand sketched look of these exquisite pieces. I knew that I had to try his technique for myself.
An excellent writeup of Petros Vrellis process is found on his site at A New Way To Knit.
Petros did not go into detail on his algorithm for generating the threading algorithm. Vancouver Hack Space member Dan Royer helped out with providing his own implementation of this weaving algorithm.
You can find Dan's version of the Portrait Thread Weaving Code on Github
You can also watch Dan's algorithm in action on his Youtube video.
Dan runs a company and website called https://www.marginallyclever.com which is a great resource for DIY robots and robot generated art.
I have a new found respect for Petros Vrellis having experienced the amount of work that goes into producing one of these pieces. The preparation time for the bicycle rim with drilling two hundred holes and attaching paperclip hooks plus the time it takes to thread a wheel is not insignificant. There is also the time spent fine tuning your images and learning what will work and what will not. I liken this process to exposing and printing an image in a darkroom. You're not quite sure what you will get until it is printed. This piece took me well over 40 hours to figure out and complete.