I recently became fascinated by what some people were doing with string art. Previously I had only ever seen people make patterns, but now some very clever people are making photos out of a single length of string! This really caught my attention, the creativity, the math, the hands-on fun.
Obviously, I wasn’t going to let some software package do all the fun work for me, so I decided to write my own software! It turns out that it’s a bit tricky to get the photos just right, some photos work better than others, but figuring it out is all the fun!
My software takes a photo and places a bunch of hypothetical nails around it, starting at an arbitrary nail 0. It then tries drawing a line from that nail to all other nails and sees which line falls over the darkest part of the image. Whichever path draws the darkest line becomes where we put our string, and we lighten that path in the image to keep us from drawing over it again. Iterating on this algorithm will build up an image in string. There are a few customizations, like the next string must be a certain distance from the existing nail, so your algorithm doesn’t make a dark ring around the entire image.
My software was developed for my use, so it’s not overly pretty and it will crash if not used carefully. You load an image, select a radius in pixels for how large the ring of nails should be, select how many nails, and how many iterations of string you’d like the algorithm to run for. The resulting image and list of nail numbers can be found using the tabs along the top.
I have made two of these out of 2ft wooden rounds, but they’re images of my children so you’ll just have to take my word for it that they came out amazing!