Skip to content

iurrutia/image2pattern

Repository files navigation

README

image2stitch

A mini-project to make images into knitting pattern colour charts using k-means. Demo version (limited memory): https://image2stitch.space

The back-story

Some time in 2012 or 2013, my then-roommate went to Blizzcon. I was just learning to knit, and I was also very much into learning how to four-gate (I wasn't very skilled at Starcraft). Long story short, I created a zerg colour chart, and knitted a sweater for Manfred, Starcraft caster Day9's stuffed bunny toy. The pattern I made is here: link My roommate gave the sweater to Day9 at Blizzcon:

But what if you are not a zerg player, like Manfred the bunny?

We can output a knitting chart for that looks like this:

What does the app do?

Knit stitches are wider than they are taller (1.25 wide = 1 tall). Images are resized to the correct ratio, then pixelated. The colour space is reduced by performing k-means clustering on the rgb or hsv colourspace for the image. The user is shown a preview of the image with the reduced colour set, and given the option to download a file (dataframe) with the colour labels k-means (relabelled from zero to n, the number of colours).

How to use

Online version

(Can only handle so many requests...)

Live App: https://image2stitch.space

To clone and run:

Requires python3 and pip.

pip install -r requirements.txt

streamlit run front_end.py

About

Web app to turn images into knitting charts using k-means

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published