Computer-Designed Portraits, Knit By Hand!

Artist [Petros Vrellis] has done something that we’ve never seen before: his piece “A New Way to Knit” lives up to its name. What he’s done is to take the traditional circular loom, some black thread, and toss some computing at it. And then he loops the string around and around and around.


The end result of following the computer’s instructions is a greyscale portrait. Where few black strings overlap, it’s light, and where more overlap, it’s darker. That’s the whole gimmick, but the effect is awesome. As you zoom in and out, it goes from a recognizable face to a tangle of wires and back. Check out his video embedded below.

There’s at least a few ways to do this, so we e-mailed [Petros] to ask. He assigned darker pixels in the original image a higher score, and ran the string to the opposing pin that maximizes the sum of the pixels passed through. With each string, he subtracted off a bit of darkness from all of the pixels along the string’s path, and repeated, starting each time at the new pin location. Each string has “only” 200 choices to make times 3000-4000 passes, so a computer should be done in no time. Tuning this algorithm to work just right, and look good with real string is probably just about as easy as it sounds. For instance, he had to include code to break ties.

Although we love the man-machine cooperation on the piece, [Petros] mentioned that he’s tempted to automate the weaving. Check out his two pendulum-based pieces (here, and here) if you like more machines in your art.

While on the topic of portraits made with black string, we have to remind you of this previous art piece that does all the work of actually laying the string out by using a modified 3D printer. Beauty is in the eye of the beholder, but we have to say that if art were judged on a difficulty scale, [Petros] would win for using only a circular loom. Never mind that he did it all by hand.

56 thoughts on “Computer-Designed Portraits, Knit By Hand!

  1. What a clever idea, this is amazing work! After doing fifteen of these things, though- yep, time to automate! Just a carousel would be an immense help, where the computer turns the loom to each successive attachment point.

    1. Polar coordinates! If the computer turned the loom (always in the same direction) so that the next attachment point was at the top, then a simple mechanism (with a tensioner) could loop the thread over that point. Much easier than any sort of XY plotter arrangement.

    2. Maybe one of them ring of LEDs, like the clock from the other day, to tell him which pin to connect to which. Lay the portrait in the middle of the ring each time.

  2. Cool idea. I like the view of it.
    The appearance of a portrait within the obvious constraints of a piece of string is quite captivating.
    Making these things on recipie from a computer just seems a waste of human resource though.
    Reminds me of the girls who were wiring ferrite (rom/ram) by hand for the first space shuttles.

    My guess is he’s able to sell one of these art pieces for more than a CNC to make these things cost.
    On second guess, he’s probably only able to sell these to people who don’t know what CNC is.

    I wonder if he has taken the thickness of the pins into account and wrapping the wire (c)cw for higher resolution.

  3. So it’s just string, going from X pin to Y? That’s amazing! Seems like a brand new, original idea too. Clever bloke.

    I don’t think it’s properly called “knit” though.

  4. “Where few black strings overlap, it’s light, and where more overlap, it’s darker.”
    Literally where they overlap it’s lighter but where they are close together not overlapping it’s darker. You get sort of ‘caustic’ effects. My grandmother had an abstract piece, probably 50 years old at least, that included gentle curves that were very strongly defined. I think there is a better way to work this math.

    1. Yes, it’s quite similar. Doing this with thread is pretty awesome; I really like the results.

      I was thinking of CT back in 2013 and came up with the idea of a laser display based on the same principles. I ended up writing a simulator but never found the time to make a prototype. I just now threw what I had on – I think you could pretty easily make a real-time display this way.

  5. That is truly inspired work, a great demonstration of art and mathematics, perfect for motivating students who are having trouble “getting” the beauty inherent in mathematics.

  6. I wanna do a negative….. black paper backing….. instead of hooks…. multicolor 3mm LEDs, obviously angled a bit…. then lace it with fishing line or similar monofilament….. use ArduPiThing to cycle colors of LEDs….

    …. do one each of Elvis, Marilyn Monroe and Kramer from Seinfeld and get them in the malls for Christmas.

    1. I gave it a quick try calculating the string’s scores by accumulating the pixel values. The simulated result is not close to what he achieved. Seems there is quite some clever tuning required. If you’re still interested, I can publish my code (C++ and OpenCV).

      1. It is more closely related than you think, if you actually understand what you are looking at. With the string there are extra constraints but the process of discovering the correct geometry sequence is the dame idea. Unfortunately the source code for JNetic does not seem to be on that site so modifying it to add the required constraints is not possible therefore you would need to start from scratch and write a tool to do it for you.

      1. Process, simplified:
        1. create a small reference image (for example 200×200 pix, a bigger one will not produce better results)
        2. create a stack of all possible lines between the pins (in my example I don’t want lines between pins that are less than 30 pins apart)
        3. pick a random starting point
        4. try all line options from this point according to the stack, calculate which option has the lowest total pixel error compared to the reference image
        5. draw the line, and remove from stack (both ways, because I don’t want the same line used twice)
        6. repeat 3000 – 5000 times

    1. For the images above I implemented a couple of subalgorithms, for example to guarantee even line distribution, additional focus maps for accurate representation of crucial details, etc.

      I think the optimal number of pins is dictated mostly by the desired resolution and the line width.
      These 2 factors together determine the maximum achievable black coverage.

      A “perfect” picture is impossible because lines have to cross lighter area’s to cover darker area’s.
      Obviously, images with darker colors at the edges are more suitable, but you could also use white lines on a dark canvas to create a picture with a light background:

      1. Very interesting…

        I also noticed that when I run your animated Tyrion Lannister link multiple times and compare the resulting images, each “knit” varies slightly.

        Is this a variation that you purposely built into the algorithm?

        I am a complete new to programming but am very interested in where to begin learning how to do this.

        1. The variation is not in the algorithm, but in the function that displays the results.

          The algorithm is not included, but the pin sequence is in the config.lineSequence array in the display.js source:

          Each pin has a number assigned to it: 0 – 199.
          0 is the pin at the right (at 3 o’clock), the pin numbers count up around the clock.

          I wanted to simulate thread in real life, which will not be perfectly straight between the pins.
          Overlapping identical patterns (in this case the lines from each pin to the other pins) tend to produce secundary patterns (moiré).
          These secundary patterns are cancelled out by random variation of the line curves.
          So most lines are not perfectly straight, but have an almost imperceptible quadratic curve of which the maximum center offset can be set by the linevariation variable in the url.

          If you set linevariation=0, the result will be exacly the same each time, but you will see moiré patterns:

          You can contact me at if you want help to get started.

          1. Simply ingenious…I wonder if moire patterns are as apparent on a physical knit, or whether it’s mostly a consequence of the limited resolution of digital renderings.

            I imagine threading with some degree of slack (or anything less than fully taut) will be problematic, as slack from successive threads would inevitably accumulate until at least one loop falls off its pin.

          2. @Harry: I don’t know, I guess we just have to try :)
            I think it would help if the pins are slightly pulled back, to prevent the thread from falling off.
            Maybe thread with some elasticity works better than very rigid thread, but you also have to take into consideration how the properties of the thread will change over a longer period of time.
            I’m planning to build a frame and do some knitting after my holiday break.
            I will post the results here for anyone who’s interested.

            2 extra examples:

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s