Algorithms of Multi-Coloured Knitting

I’ve already posted about hacking a knitting machine to accept multi-colour patterns. Today I’d like to expand on that with some work I’ve done recently to improve the multi-colour algorithm.

When I knit in multi-colour I use a method called Double Jacquard. This involves the Brother KM-950i, ribber KR-850 and colour changer KC-900.

Different coloured yarns are held in the colour changer on the left. Moving the carriage right with one coloured yarn will simultaneously knit the yarn into the front (knitting machine bed up top) and back (ribber bed down the bottom) to create double-layered knitting.

The result is a multi-coloured pattern on the front and a simple pattern called Birds Eye to tie all the loose yarn together on the back.

Knitted pattern on the front, knitted birds eye on the back and purls in the middle. I also sell these personalized baby blankets on Etsy.

But we can do better than this.

There are several complexities to be aware of with this setup. For each row of knitting in the fabric the carriage has to pass over the knitting twice for each colour. Once to go to the right edge of the knitting machine and again to get back to the left to change colours.

That means for a three coloured pattern, there’s six passes of the carriage to knit one row in the fabric. It’s a lot of work!

In the interest of keeping the process as simple and stress-free as possible, I try to use the same sequence of colours all the time (1,2,3,1,2,3,1,2,3) and never change the ribber settings as I knit (although there are some fantastic variations you can try if you’re so inclined).

My first multi-colour hack created patterns that incorporated these ideas, but it only works by doubling the height of the pattern (using pattern variation switch 4 on the knitting machine) to enable the carriage to return to the colour changer.

Double height using pattern variation switch 4

Obviously, this isn’t ideal as it means there are two knits for every pixel in the original image. Four knits if you want square pixels using the double width as well (pattern variation switch 3). The results get very pixelated!

Double width using pattern variation switch 3

Alessandrina also posted about this issue a few years ago to help punch card knitters plan their multi-colour work by hand. Unfortunately, she didn’t provide any workable solutions aside from my double height method.

Thing is, I KNOW for a fact multi-coloured double jacquard can be done using one knit per pixel. I know because other very talented machine knitters such as Woolly Wallaby have shown me it can be done. The fancy Passap E6000 can do it (clearly using some kind of dark magic). Sadly I don’t have access to such clever machines to understand how they do it.

Phew, that’s an awful lot of typing and I’ve only just introduced to you the basic premise of what I’ve been up to.

So what HAVE I been up to? Theoretical knitting of course! I’ve been theorizing how machines like the Passap E6000 might generate multi-colour patterns with one knit per pixel. And with a single colour changer on one side no less. Excitingly, I’ve come up with a benchmark of a few possible algorithms! It nearly did my head. Here are the results.

1. Double width, double height method

This is the original method I described above, knitted here to benchmark against the theoretical methods. It’s just a standard pattern which works with the double height pattern variation switch so the carriage can return to the colour changer after each pass. Double width to get square pixels.

1.5 rows of birds eye knitting in the back for every row in the front so overall elongation of the work is kept to a minimum. 456 total rows of knitting this test pattern.

2. Offset every first and last colour method

This method offsets each line just like the KRC pattern variation switch. This means it knits the last colour in the previous row and returns by knitting the first colour of the next row. The only way I could work out how to knit a third colour into this method is to return with a blank row, although dithered would probably work as well.

2 rows of birds eye knitting in the back for every row in the front causing some elongation. 283 total rows of knitting this test pattern.

3. Blank second pass method

This method is the simplest. Every row in the pattern is followed by a blank row to allow the carriage to return to the colour changer.

3 rows of birds eye knitting in the back for every row in the front causes worse elongation. 456 total rows of knitting this test pattern.

4. Dithered method

The first colour, first row in the pattern knits every first needle. The first colour, second row in the pattern knits every second needle.

3 rows of birds eye knitting in the back for every row in the front. Oddly the elongation is worse than the blank second pass method. 456 total rows of knitting this test pattern.


The double width, double height method has its charms but the clear winner here is the offset method. It has a negligible amount of elongation, the least number of passes overall and is able to achieve the one knit per pixel goal.

Look ma, one knit per pixel. I just quadrupled my knitting resolution!

I’ve released an update to the multi-colour hack so you can choose which algorithm you want to use. If you don’t define an algorithm it’ll use offset by default. Enjoy!

Close up of the offset method. Click to zoom!

If you have a fancy knitting machine like the Passap E6000 or know how they calculate multi-colour patterns PLEASE GET IN TOUCH! I’d love to know if any of this work even comes close to how they do it.

Sarah Spencer

I’m the crafty type. I enjoy lead lighting, knitting, crochet, screen printing… the list goes on! I also work in IT so I write code from time to time.

You can find me on Github and Twitter.

Latest posts by Sarah Spencer (see all)

12 Replies to “Algorithms of Multi-Coloured Knitting”

  1. Love your post, patterning it is an incredible amount of of work and appreciate that you are sharing and showing your results.

    I am a Passap E6000 knitter so most of the terminology you use with “switch”, dither, double width are terms I am not familiar with. So I guess the Passap is magic! The elongation happens with Passap as well, for the birds- eye patterning on the reverse.

    1. Thanks for your reply! It’s helpful to know the Passap E6000 also has elongation with birds-eye as that tells me I’m on the right track. Don’t worry too much about the terminology I use though, I’ve made it up because I can’t find any information about this stuff anywhere else 🙂

  2. I love the work you’re doing on this. I am, however, somewhat skeptical. I have done intensive work on the same subject myself. If you choose one of Wooly Wallaby’s pieces that has 3 colors, and zoom right in, you’ll see that, in fact, all of the stitches are double. There are no single height stitches. It might be worth writing to ask the creator. Likewise, if you look at all of the 3 color patterns that are in the E6000 repertoire (the preloaded patterns) they are all double height, as well.

    I, too, thought that I had conquered this dilemma years ago with a slightly different algorithm. My initial swatches were very promising. But I was fooled. The design I used for initial testing was coincidentally suited to single stitch high knitting, and I didn’t percieve the areas where it wasn’t working, though on closer inspection later I could see that they were there. However, when I started to knit larger, much more complex pieces they turned into total confusion. What I realized was happening was that some stitches were getting stretched over 6 rows, while others were not knitting where I wanted them too.

    I did, finally, succeed in knitting a single pixel resolution piece, using a sequence of color 1,2,3,1,2,3 and picking up and dropping each color after a single pass. A LOT of hassle, because to change colors on the right side means disconnecting the ribber carriage from the connector arm and winkling the yarn between the carriages. Also, this only works with and odd number of colors. if you are knitting with an even number of colors, you have to knit 1,2,3,4,4,3,2,1.
    I will be very interested to see what results you get if you go to a very complex, multi-color piece.

    1. Hi Tanya,

      Thanks so much for your comment! I really value your expertise on this subject since I’m just exploring it for the first time myself.

      I’ve added a close-up photo to the bottom of my blog post so you can better see the results of the offset method on the two test patterns I’ve done. I think it’s safe to say this is a success on three colour patterns ♥

      I haven’t tested more than three colours so far, but I’d theorize it’ll work for four colours as well. You’re right in saying the more colours the greater the elongation problem given the restraints I’ve described above.

      I know commercial knitting machines change colours on both the left and right side. Makes me sad that neither the Passap nor the Brother are designed for colour changing on both sides. The new kickstarter Kniterate does though which is very exciting!

Leave a Reply

Your email address will not be published. Required fields are marked *