KnitML: standards-defined knitting patterns

KnitML is a community standards effort aimed at defining a universal, machine- and human-readable system for describing knitting patterns:
* Render a pattern in either written directions or a chart, dependent on a preference setting
* Render a pattern in any language, using conventions familiar to that language and dialect
* Validate that a pattern is physically possible to knit (eliminating some types of errata)
* Automatically convert English measurements to and from metric measurements
* Size a pattern up or down to any size, not just the sizes that come with the pattern
* Recalculate a pattern for your gauge rather than the one that came with the pattern
* Explicitly write out mathematically complex directions (e.g., "increase 34 stitches evenly over 171 stiches")
* Alter the pattern using an easy-to-use graphical editor (or create new KnitML-based pattern from scratch)
* Preview the result of a pattern using graphics
* Integrate into your favorite knitting software (such as Sweater Wizard)
* Digitally sign the pattern to guarantee original authenticity
Link (via Making Light)


  1. Oh, I can’t believe this! I am actually writing a DTD on this very subject. Shoot, I wanted to be first…

  2. Yanajenn – the community could use lots of help on this. I know the schema has seen a lot of discussion on (in the KnitML group).

  3. If this comes to fruition, you could write “test patterns” and have it virtually-knitted to check the results before you start. Wouldn’t be too long before someone writes a backward-engineering program for folks to draw a sweater, and print out the knitting pattern in KML…

  4. I think I’d rather just read a chart. And I like doing the math myself for size changes and complex increase/decrease instructions. Though I agree that having uniform terminology would be great.

    For once, I am a luddite.

  5. “* Digitally sign the pattern to guarantee original authenticity”

    That kind of sounds like some form of DRM to me…

    If so, wouldn’t this be rather forbidden on “the Boing Boing”?


  6. “Validate that a pattern is physically possible to knit”

    Okay, great, after all is said and done and committees have met, conferences are held, telephone -book-sized specs are shipped and MOUs signed, what we get from this is….Provable Knitting?

  7. This post reminds me of a presentation I attended at GECCO 2007, an evolutionary computing conference that was held in London this past July. The title of the presentation was “Evolution of lace knitting stitch patterns by genetic programming”. The confluence of old and new worlds intrigued me.

    Here is the citation:

    “In this paper we study the generation of lace knitting stitch patterns by using genetic programming. We devise a genetic representation of knitting charts that accurately reflects their usage for hand knitting the pattern. We apply a basic evolutionary algorithm for generating the patterns, where the key of success is evaluation. We propose automatic evaluation of the patterns, without interaction with the user. We present some patterns generated by the method and then discuss further possibilities for bringing automatic evaluation closer to human evaluation.”

  8. Kimi: thanks for mentioning the Ravelry group! I went and found it (and joined it). I’m only a beginning knitter, but I’m happy to contribute to the effort any way that I can.

  9. …Can you see trojans and viruses for this specific language and it’s compiled/interpreted apps?

    UNRAVL: Picks a weak link in the knit and unravels the whole mess from that point!

    TWINEBALL: Similar to UNRAVL, but sends the unraveled yarn to another knitter, where it’s used to make what the h@kk3r wants!

    MOTH: Simply eats holes in the knit until it falls apart.

    …Which leads us to the competition between WOOLITE and MOTHBALL for antiviral/antitrojan supremacy!!!

  10. Nobody’s going to gain favor with the moderator by speaking ill of knitting.

    Al (6), it’s not just the uniform terminology. This could make proofreading easier and reduce the incidence of errors in instructions. (I speak as one who found a large typo in A Gathering of Lace the hard way.)

    MHotel (7), knitting has been crossbreeding with computers for a long time now.

    JamesMason (8): no, it’s not. And knitters’ mailing lists and newsgroups were having copyright arguments before the Web was invented.

    Dillo (9), “representable” is more like it.

    Doranchak (10), my further reading was stopped by a password. How did the genetically-generated patterns look? Any good ones?

  11. I wondered why so many people were visiting all of a sudden. Now I know. :) Thanks for all of the feedback on the project. I hope lots of people will join the effort.

    In response to Al’s post (6), the point of developing KnitML is not to create an alternative to reading knitting patterns for humans. Rather, it would serve both as a way to express a knitting pattern as an algorithm that a computer can understand as well as provide an interchange format for software communication.

    If you prefer to read charts but a pattern only provides written instructions, you have to manually get out the graph paper (or spreadsheet with fancy fonts) and chart it yourself. If, on the other hand, you have the KnitML for the pattern, you can use your rendering software with the “always chart when possible” option set to transform the pattern into a chart.

    And if you prefer to do your math by hand, by all means don’t use software that would provide a transformation. The point is that there are plenty of knitters out there that do not like math that, given the chance, would prefer a piece of software to do it for them.

  12. Thank you for the explanation, that makes a lot more sense and I certainly see the appeal of having such a tool.

    The “math is scary” sentiment seems to run a little too strongly sometimes, especially considering that playing with the numbers can often give a deeper understanding of pattern construction. But then, I like knitting as brain exercise as well as relaxation which I know isn’t how everyone approaches it.

    I’ll be keeping an eye on this. I’m excited to see how it could be adopted and used for everybody’s benefit.

  13. Following up on Doranchak’s (10) discussion of genetic programming and lace patterns: knitter Debbie New is one of many mathematically-inclined knitters using agent-based and cellular automata algorithms to generate patterns (which you can use for either color or texture). Here’s some background on cellular automaton knitting:

    Some of the coolest stich patterns I’ve come up with are due to this technique.

Comments are closed.