Close
0%
0%

DIY Knit Portrait

Software to create your own Knit-like string pictures.

Public Chat
Similar projects worth following
I created 2 programs that lets you make your own "Knit" pictures. Based on the description of how the algorithm for the original Knit pictures works, I created my own algorithm that takes an image and converts it into a string picture.
Knit_Generator.exe can convert images to string pictures and exports the instructions.
Knit_Instructor.exe can open the instructions and tells you how to string the frame.

Download here:
https://drive.google.com/open?id=19rcw84hp6OVy7-0c_rH_Gss5SRGS3Bu5

Here's the page of Petros Vrellis, the artists that first used this method (to my knowledge): http://artof01.com/vrellis/works/knit.html
  • Finished my first portrait!

    Raphael Schaaf12/15/2020 at 23:31 4 comments

    I finally finished my first portrait!

    And as any great artist has to have one, I decided to make a self portrait ;D

    Here are some pictures of what it looked like in the software and the finished product:

    I'm quite happy with how it turned out :)

    Some notes:

    The wooden ring is not strong enough for 3000+ lines of string, it gets slightly distorted into a "pringles" shape. This might cause a loss in details. A second ring glued to it might help with that.

    The picture can't be hung directly on the wall, as not enough light passes through it and there wouldn't be sufficient contrast between the string and the background, making the image too dark. A backlight would help with this, but I just hung it from the ceiling, about 20cm from the wall.

    It turned out slightly darker than in the software, keep that in mind if you try your hand at one of these string portraits :)

  • Settings explained

    Raphael Schaaf11/11/2019 at 22:28 2 comments

    Since I get some questions about the settings from time to time I thought I'd explain them a bit better:

    Radius:

    The radius of the circle in pixels. Does not have any connection to how large you want to make the actual portrait. A bigger radius will make a more precise portrait, but will also take longer to compute. Use a small radius for quick previews and a bigger one when creating the final instructions for your portrait.

    Hooks:

    The number of hooks or nails you will use. More hooks make for nicer portraits with less geometric artifacts, but take longer to compute. Keep in mind how close together you can fit the hooks/nails.

    Lines:

    The number of lines that will be drawn between the hooks. Good values generaly between 2000-3000. When the generating process is near its end and all the new lines are placed around the border of the ring you have too many lines. When they are still being placed through the ring you have to few lines. Try to find a good balance.

    Contrast:

    The most tricky one to figure out. Basically the value that gets subtracted from every pixel when a line passes through it. A higher value should be used for thicker threads or smaller portraits. 20-50 seems to work fine.

    Scale:

    Zoom in and out of the picture with 1 & 2.

    Offset:

    Move the picture with the arrow keys.

    Detailled view:

    To open & close a more detailled view of what is going on during the generating process press D. This will show all the lines calculated so far and the remainder of the source image. Will slow down the calculation imensely, so don't leave it open.

View all 2 project logs

  • 1
    How to use Knit_Generator
    1. Open Knit_Generator.exe.
    2. Press Space to load an image (.png, .jpg, .bmp should work).
    3. Position the part of the image you want converted inside the circle using the arrow keys to move it and 1 & 2 to scale it.
    4. Set the number of hooks, radius of the circle (bigger = more accurate but slower calculation), number of lines and contrast (contrast is inverse, higher number will create a flatter image).
    5. Press Enter to start the calculation (takes a couple of seconds to initalize).
    6. Pressing D during the calculation switches the drawing of the lines on and off. Can be used as a preview, but will slow down the calculations extremely if left on.
    7. When finished, press S to export the generated image as an .ini file containing the instructions for assembly.
  • 2
    How to use Knit_Instructor
    1. Open Knit_Instructor.exe.
    2. Press O to open a previously generted ini file.
    3. A single line will be displayed at a time, with the instructions from and to which hook to connect the string.
    4. Cycle through the steps with Enter and Backspace.
    5. Use J if you want to jump to a specific step.
    6. Use T to toggle the Image on and off.

View all instructions

Enjoy this project?

Share

Discussions

afu2guju wrote 04/14/2021 at 05:42 point

.ini file not saved when pressing S. Anyone else facing a similar issue? 

I am on windows 10.

  Are you sure? yes | no

Apollo wrote 7 days ago point

yes. nothing happens when I press S. I think the program is broken.

  Are you sure? yes | no

afu2guju wrote 04/12/2021 at 21:23 point

I bought a 12-inch wreath ring, black thread and nails to get started with the project. 
I am struggling to mark the point on the circumferences of the wreath ring to hammer the nails. What would be the easiest way to mark the points on the ring?

I tried printing but just realized that I only have Letter size paper (8.5 inches x 11 inches). 

  Are you sure? yes | no

mainaim7 wrote 04/13/2021 at 00:22 point

print to one edge of your (8.5 inches x 11 inches) creating a "C"

print two copies then tape the two pages together to form your circle matching the pin points

  Are you sure? yes | no

afu2guju wrote 04/13/2021 at 18:05 point

I did something similar using https://www.blocklayer.com/circle-dividereng.aspx
Gives all the instructions on how to adjust and print the image over multiple pages.

  Are you sure? yes | no

pouria wrote 04/11/2021 at 09:46 point

hi

can you guys help me,how could i pounding pins that those will be more tidy?

  Are you sure? yes | no

Den and I wrote 04/07/2021 at 13:43 point

Hey! We just added multicolor pattern support! Check it out - https://app.diegumeistars.lv/. Will be glad to hear any feedback.

Example

  Are you sure? yes | no

Den and I wrote 04/07/2021 at 15:05 point

here is short demo https://photos.app.goo.gl/Nu599sF3pbZioj39A

  Are you sure? yes | no

Raphael Schaaf wrote 04/09/2021 at 04:31 point

Wow that is amazing!!!

Did you try it out irl yet? And are the instructions one color after another or are they mixed, sorted by the 'importance' of each line?

  Are you sure? yes | no

Den and I wrote 04/09/2021 at 04:43 point

We just added this feature and are making our first color portrait right now. I'll probably will add a result here today or tomorrow.

Colors go in chunks of 100(+/-). So it basically goes like this - you tie your first thread and do 100 or more moves with, then app notifies you that color has to change and you tie your next color. And continues to give you instructions for each color, but when same color comes again app is aware of it's previous end point and continues from that rather from your last colors endpoint. So it basically made to be as easy to thread as possible.

  Are you sure? yes | no

Den and I wrote 04/09/2021 at 04:46 point

One important thing is direction of knitting. It only matters when there are multiple colors. The front and back of your image are different now. So it is important to know are you knitting back to front (pins fill facing forward in the end, like on solid board) or front to back (pins will be facing the wall, like on hollow frame).

This property is back to front by default in Project section and front to back for published option, and only can be changed for published ones at the moment.

  Are you sure? yes | no

Raphael Schaaf wrote 04/15/2021 at 12:35 point

Awesome :D

We were discussing the importance of the direction of knitting somewhere else, glad to see you implemented that :)

Does your algorithm somehow use later lines to cover up "mistakes" of earlier lines? Like for example, a yellow line passes through pixels that don't contain yellow, does it increase the other color values so later lines will be more likely to go through this pixel and hide the line behind it?

  Are you sure? yes | no

mainaim7 wrote 04/14/2021 at 03:32 point

I'd love to try it.

I use a hollow bic pen with 1/2 inch protrution of ink cartridge to go around the pins. Stuff the other end to give tension. Using one of these for each color, rather than cut and tie next string, you could loop the last string and continue with the next one. The next time you could go around the outside of the perimeter to get to the next one.

What do you think?

  Are you sure? yes | no

Den and I wrote 04/14/2021 at 19:47 point

Each individual color is one continuous sequence without interruptions. So let's say you have 3 colors, that means you will have 3 complete sequences that are just mixed with each other. So yes, when you switch to next color you just leave the previous where it was and next time it comes around you continue straight from there. It's done like this with porpoise to make real knitting as convenient as possible.

  Are you sure? yes | no

davidmmeyers wrote 04/14/2021 at 19:39 point

hey. love playing with this!  how do you name and save the color to apply to portrait?... color names are confusing.. to save

  Are you sure? yes | no

Den and I wrote 04/14/2021 at 19:52 point

You click the 3-line button to get to preferences where you can add thread colors that you have.

From my point of view it makes more sense to generate patterns from colors that you actually have rather than determining precise palette of an image, because in real world scenario you will never able to find a thread that matches arbitrary color in the image precisely.

Names are needed mostly for differentiating similar colors. If you have let's say 50 colors available the chances are that there will quite a few 'red' ones. So with names you are able to differentiate them easier.

  Are you sure? yes | no

davidmmeyers wrote 04/14/2021 at 19:59 point

ok cool thanks... BUT .. sorry to be dense... to add colors to the palette..  I see three fields to fill in... 1 "thread color name".  2. thread code optional.  3. thread color #0000.   When I fill in field 1:  "blue"  then field 3: "blue" in thread color     the add button is shadowed and cant click it...   not sure what I am doing wrong.. need a hashtag?.. special name code?..   ALSO... does the raindrop do anything... looks like you can click it but nothing happens...  it lets me add the color if I use a # adn 3 digit number... ( is there a coder for each color?...)

  Are you sure? yes | no

Den and I wrote 04/14/2021 at 19:57 point

As I promised here is a real life example of final result https://photos.app.goo.gl/Ht664wS1Mp9xRr6S9.

And here is how project and original image looked - https://photos.app.goo.gl/SPgEsqp99yikvN7f9.

I would say looks exactly as expected.

We are using hollow frames, which cannot sustain more that certain amount of string tension. So we were limited to 4500 steps for this one. And chose the picture accordingly to look good 'just' with 4500 steps. But in general I find that picture takes 7k-9k to look maximally good. We are going to do picture like this when our solid back frames will be ready.

  Are you sure? yes | no

davidmmeyers wrote 04/14/2021 at 20:02 point

looks great!!!!

  Are you sure? yes | no

fahimeh wrote 03/24/2021 at 18:58 point

Hi

What is the unit of radius? centimeter?

  Are you sure? yes | no

Raphael Schaaf wrote 03/26/2021 at 05:51 point

https://hackaday.io/project/130951-diy-knit-portrait/log/170841-settings-explained

  Are you sure? yes | no

kikigongo wrote 03/18/2021 at 10:45 point

Hi 

Where knit generator save the istruction?

because when knit generator has converted image, and i hit s to save the data and then i open knit instruction to open the file i can't find it. thank you

Icona di Verificata con community                                     

  Are you sure? yes | no

Raphael Schaaf wrote 03/26/2021 at 05:52 point

A window should open where you can select the location it saves to

  Are you sure? yes | no

davidmmeyers wrote 03/03/2021 at 22:58 point

anyone yet figure out color portrait... like art.nitka   I have been able to do the B and W but those are WOW!

  Are you sure? yes | no

Raphael Schaaf wrote 03/26/2021 at 05:50 point

As far as I know they made their own software, it probably uses the same algorithm but splits the image in different color channels.

  Are you sure? yes | no

titusgx wrote 10/16/2020 at 12:34 point

Hi, could you share the code of your .exe, so we can convert to other languages and make it compatible for everyone? @Dan Royer has an older version. could you upload yours?Thanks, regards

  Are you sure? yes | no

Raphael Schaaf wrote 12/11/2020 at 12:38 point

Hi, I'll see what I can do. I'm planning on updating the project page this weekend :)

The code was written in GameMaker Studio, I have no idea how easy it would be to convert into other languages... But I guess the important part is the algorithm, which you can extract from the code :)

  Are you sure? yes | no

Raphael Schaaf wrote 12/17/2020 at 00:56 point

I just realised that the code is already in the google drive folder, the main algorithm is in the controler object.

  Are you sure? yes | no

richvhigga wrote 10/04/2020 at 06:04 point

Hi, just a question, how big our ring have to be?

  Are you sure? yes | no

registro.suscripciones wrote 08/26/2020 at 12:29 point

Good job!

  Are you sure? yes | no

artrapid wrote 04/29/2020 at 13:09 point

Hi all, please also try out the web app on our site at https://artrapid.com/ . The processing happens server-side and the number of hooks are fixed (at 300) but we have a few additional options. No registration needed unless you want to keep your creations private.

  Are you sure? yes | no

titusgx wrote 10/16/2020 at 12:34 point

hi its look nice, could you share your code?

  Are you sure? yes | no

artrapid wrote 10/28/2020 at 16:44 point

Thanks, @titusgx . I don't have the code on GitHub, but the algorithm is based on @Christian Siegel 's code at https://github.com/christiansiegel/knitter .

  Are you sure? yes | no

Yannk wrote 04/24/2020 at 13:23 point

Hi ! Is it possible to convert  a sacred geometric image ? 

  Are you sure? yes | no

rrsh007 wrote 04/05/2020 at 10:25 point

hi..why when i press S in knit dont create .ini file???please help.where is file location?

  Are you sure? yes | no

afu2guju wrote 04/14/2021 at 05:32 point

Did you find a solution to this?

  Are you sure? yes | no

Den and I wrote 02/12/2020 at 22:09 point

Hey guys, here is an web app if anyone still looking. Let me know what do you think. App.diegumeistars.lv

  Are you sure? yes | no

shaya0181 wrote 11/15/2019 at 02:31 point

what is contrast calculator for ?

  Are you sure? yes | no

Raphael Schaaf wrote 11/15/2019 at 02:39 point

In theory you can calculate the optimal contrast value to use, but I have no idea if it really works...

  Are you sure? yes | no

Dan Royer wrote 11/15/2019 at 03:24 point

did you use RGB or CIELAB color space?

  Are you sure? yes | no

Raphael Schaaf wrote 11/18/2019 at 15:00 point

no color in my version, I only use greyscale information

  Are you sure? yes | no

Dan Royer wrote 11/14/2019 at 21:21 point

I have a slightly older version of the same algorithm that runs in Processing so that you don't need to trust an EXE file or be stuck with Microsoft products.  https://github.com/i-make-robots/weaving_algorithm  Includes a few different styles like square, circle, and color (still experimental)

  Are you sure? yes | no

Raphael Schaaf wrote 11/15/2019 at 02:45 point

Nice, do you have any example images of color images? Do you split the image in 4 separate images for the CMYK channels and then run the same algorithm on each or did you use a different approach?

And what do you think would be the optimal way to string a color picture? Do all the lines of a single color at once, or do one C, one M, one Y, one K, repeat.

  Are you sure? yes | no

Dan Royer wrote 11/15/2019 at 03:08 point

I've tried a few things with color images, including CMYK.  nothing really satisfies yet.

  Are you sure? yes | no

idisc wrote 10/21/2019 at 08:48 point

Proof of concept. Here are two thread portraits I made of John Lennon https://imgur.com/q5PShL6 and Alexander the Great https://imgur.com/NzFcZMs Thanks Raphael.

  Are you sure? yes | no

Gerben wrote 10/21/2019 at 15:29 point

Looks very nice. Thanks for sharing.

  Are you sure? yes | no

Raphael Schaaf wrote 10/26/2019 at 02:17 point

WOW! That's awesome :D

I just bought some of the materials for my first string portrait. I want to make a self portrait :)

  Are you sure? yes | no

idisc wrote 10/28/2019 at 17:45 point

I used a 39 centimeter wooden disk from an IKEA lazy susan and painted it with matt white paint. A CNC was used to evenly drill holes into the wood. Appropriate brass nails were used. I numbered the nails from 0 to 199 with adhesive paper labels. The lazy susan was left on the base to make it easy to spin to the appropriate nail positions, and the lazy susan was removed upon completion. Hope this will make construction easy.

  Are you sure? yes | no

Raphael Schaaf wrote 10/26/2019 at 03:19 point

Can you tell me how similar they are to the preview generated by the program?

  Are you sure? yes | no

idisc wrote 10/28/2019 at 17:36 point

The results are similar, however you have to have extreme contrast (black on white) and where black becomes too invasive you can mask the area and apply a light coat of white spray paint to soften the excessive black.

  Are you sure? yes | no

idisc wrote 11/08/2018 at 14:55 point

Rafael,  Do you have plans to create the DIY knit for a square shaped knit?

  Are you sure? yes | no

Raphael Schaaf wrote 04/14/2019 at 20:42 point

It wouldn't be too difficult to do, but I'm not planning on investing much more time in this project

  Are you sure? yes | no

Gerben wrote 04/15/2019 at 15:23 point

I've tried squares, but they don't look . At least in simulation. You get some weird "interference" patterns. It also looks more geometric/blocky, instead of the more organic results you get with circles. Same for hexagons, though not that extreme. Circles tent to look the best, somehow.

Here's my semi-finished online "knitter": https://gerben.algemeenbekend.nl/threadtone/
Where you can select multiple shapes.

  Are you sure? yes | no

Raphael Schaaf wrote 04/21/2019 at 08:42 point

@Gerben Wow that's really interesting!

As far as I can tell the main problem with squares / hexagons / etc is that there will never be a jump to a hook on the same edge, which severly limits the number of options for a jump, on a square you get 25% fewer hooks as an availlable target.

The second problem that I can see is that the diagonals will always have the highest weight / priority, since there will be the most pixels between them, which causes them to be favored over other hooks.

Maybe one way to partialy fix these problems would be to only use a circular image, even when you have a square frame?

  Are you sure? yes | no

Gerben wrote 04/21/2019 at 12:47 point

@Raphael Schaaf  No sure if that first one is really a big issue.

As to the second problem you mentioned. On a circle, lines to the direct opposite are preferred to more diagonal lines, as those lines are shorter. I've experimented a bit with dividing the total number of black pixels on a line, by the length of the line, to negate this effect.
The downside was that the algorithm then preferred very short lines. I think I added a minimum length or something, which had the funny side-effect of  creating a second circle, a fixed offset from the edge. I think that's where I stopped, as other projects got priority.

Never really finished it. It seems pretty much everyone only does the software side of this project. I've only seen 2 projects with finished string-art.

PS I even made a page, that would speak the number of the nail that was next, so all I needed to do was press "next", an listen where to go next. (-:

  Are you sure? yes | no

chaterrony wrote 08/03/2018 at 17:04 point

I was so fascinated by your pictures, that I did an app for Android which does the same. Reason: I have no windows... (hope that my 2012 iMac dies soon to be able to purchase a windows machine again)

BUT! The power of a tablet of smart phone is so little, that it takes decades to calculate... My "longest" try was with 50 strings and it took 5min! :-( So I abandoned this. 

But my question (as I didn't got as far to be able to test it myself): You check the darkest connection from a certain point to all other points. The darkest is taken. What do you make next? Do you just go to the next point  and do the same calculation (this is the way I did it)? Or do you have another system how to pick the next point to check the next connection?

  Are you sure? yes | no

Raphael Schaaf wrote 08/06/2018 at 07:24 point

Hi, that's cool, what did you program the app in?

You're right, the point you arrive at is taken as the new starting point for the next check.

It's a very time consuming calculation, if you are able to use the GPU it could probably run much faster...

  Are you sure? yes | no

chaterrony wrote 08/07/2018 at 20:56 point

So, please don't block me immediately when I tell you how I programmed it... It's on "ai app inventor". I am trying to work with Visual Studio, but it's quite a hard start as a newbie... One day... who knows :-)

I'm for sure disappointed on the functionalities of this software (usually I work with Arduino, and even the Arduino IDE is better!) and the programming by moving blocks...

I have modified the app and I have shared it on the appinventor website: ai2.appinventor.mit.edu/?galleryId=5560843821514752

Anybody who has ideas/suggestions how to improve the code is very welcome to let me know! Thanks in advance!

  Are you sure? yes | no

Raphael Schaaf wrote 08/08/2018 at 07:16 point

That's cool, I started programming with the block functions in Game Maker :D

I still use Game Maker to this day, even for this project, but nowadays I use the built in scripting language :)

  Are you sure? yes | no

Khalid Khattak wrote 05/17/2018 at 03:36 point

Awesome superb program.. I am in fabrication of DIY embroidery machine.. All I want to get X-Y coordinate and connecting string numbers .. It will be really awesome to embroidered such patterns...

  Are you sure? yes | no

Raphael Schaaf wrote 05/24/2018 at 07:43 point

Nice, but you will probably need a piece of software to convert the instruction file to something that your embroidery machine understands :)

  Are you sure? yes | no

Khalid Khattak wrote 05/24/2018 at 07:57 point

Dear Raphael, in the past i wrote an embroidery program that convert DST Tajima file format into simple G&M code. You can see in the following video.
I just need your help in this... end coordinates of connecting lines...
https://www.youtube.com/watch?v=5IKwKiq_b7w

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates