String Art Generator

by Timothee Gillier in Craft > Art

916 Views, 16 Favorites, 0 Comments

String Art Generator

LNHH7325.JPG
lion gif long.gif
FA9L70SMBP3T93T.jpg

Welcome to a world where digital design meets traditional craft! In this project, you'll transform a simple image of your choice into an intricate string art masterpiece. By leveraging a Python program to generate precise, algorithm-driven paths and combining it with the tactile process of assembling a wooden base and evenly spaced nails, you’ll create a stunning piece that fuses art, technology, and engineering. This guide steps you through every phase—from preparing the design on your computer to meticulously installing the nails on a circular wooden canvas and finally weaving your thread along the precalculated routes. Whether you're a tech enthusiast, a DIY hobbyist, or simply someone who loves a creative challenge, this project invites you to tie, twist, and thread your way to a visually striking and one-of-a-kind piece of art.

Supplies

WhatsApp Image 2025-06-10 at 19.27.24.jpeg
Python-Symbol.png

Supplies

  1. Wooden Base: A square piece of wood large enough to yield a circular canvas (approximately 40 cm in diameter).
  2. Nails: 100–300 small nails, depending on the size and level of detail desired.
  3. Thread: dark polyester sewing thread (at least 1000m for a 40 cm diameter canvas)
  4. Paper: Sheets of paper for creating and transferring the circle template onto the wood.
  5. Image File: A high-contrast image of your chosen subject to use as the basis of your string art.

Tools

  1. Compass or Circular Template
  2. Sandpaper: Medium to fine-grit sandpaper for smoothing the wooden surface and edges.
  3. Python & Computer: A computer with Python installed and the downloaded script for generating the nail-to-nail connection pattern.
  4. Measuring Tools: A ruler, measuring tape, and a spacer for consistent nail placement.
  5. Markers & Pens: Permanent markers or pens for numbering nails and making alignment marks.
  6. Hammer
  7. Utility Knife or Scissors

String Art Generator

Capture d'écran 2025-06-10 211626.png
Capture d'écran 2025-06-10 211733.png
Capture d'écran 2025-06-10 212106.png
Capture d'écran 2025-06-10 211914.png

Setting Up Your Environment

  1. Python Platform: Download Python from python.org. I used Spyder as my IDE, but any preferred environment (VS Code, PyCharm, etc.) works just as well.
  2. Install Required Modules: Open your terminal or command prompt and run:
  3. bash
pip install numpy opencv-python
  1. These modules handle numerical operations and image processing.

Preparing Your Assets

  1. Image File: Save a high-contrast image (e.g., a lion) as a .jpg file.
  2. Folder Setup: Place your image in a folder and note its path; you will provide this when prompted by the script.

Running the Code

  1. Launch Your Environment: Open your Python IDE or terminal and navigate to where your script is saved.
  2. Start the Script: Run the script using:
  3. bash
python your_script_name.py
  1. Answer the Prompts:
  2. Folder Path: Enter the path to your image folder.
  3. Image Name: Provide the image name without the extension (e.g., lion if you file is named lion.jpg)
  4. Scale Factor: Input a number (e.g., 2) to upscale the image.
  5. Number of Lines: Specify the number of nail-to-nail connections.
  6. Number of Nails: Enter the total count of nails on your circle.
  7. Desired Circle Diameter: Input the canvas diameter in centimeters (e.g., 40).

Generated Outputs

  1. PNG Snapshots: Visual progress images saved every 50 lines, plus a final image.
  2. Text Log (string_art_info.txt): Contains the sequence of nail numbers for threading and the total thread length needed.
  3. SVG File (string_art.svg): A vector blueprint of your design, showing all the line segments.


Choosing and Preparing the Wood

WhatsApp Image 2025-06-10 at 19.27.23 (3).jpeg
WhatsApp Image 2025-06-10 at 19.27.23 (2).jpeg
WhatsApp Image 2025-06-10 at 19.27.23 (1).jpeg


For this step, I repurposed an old shelf board that I had lying around. Here’s how you can do it:

  1. Select Your Board: Look for a sturdy piece of wood that you can repurpose. I used an old shelf board that had plenty of character.
  2. Marking the Circle: Place a round bucket upside down on the board or use a compass if you have one that is big enough. With a marker, carefully trace around the edge of the bucket to outline your circle. This ensures a perfect curve without fuss.
  3. Cutting it Out: Using a jigsaw, cut along the traced line to form a circular canvas. Take your time to follow the marked contour for a neat circular shape.
  4. Sanding the Edges: Finally, apply a bit of elbow grease with some sandpaper. Smooth the edges and surface, so that your circular wooden base is both safe to handle and looks polished.


Template Transfer and Nail Spacing

WhatsApp Image 2025-06-10 at 19.27.23.jpeg
WhatsApp Image 2025-06-10 at 19.27.22 (2).jpeg
WhatsApp Image 2025-06-10 at 19.27.22 (1).jpeg


  1. Cover with Paper: Lay multiple sheets of paper over the circular board so that it completely covers the surface. This protects your board from stray marks.
  2. Trace the Circles:
  3. With a pencil, trace the outer edge of the circle onto the paper.
  4. Then, draw another circle inside the first one, exactly 1 cm inwards from the outer line. This inner circle will serve as your guide for nail placement.
  5. Initial Nail Placement:
  6. Secure the first nail by hammering it into the board at a selected point on the inner circle.
  7. Using a thin piece of wood (about 3 mm wide) as a spacer, align it next to the first nail to ensure consistent spacing along the circle.
  8. Continue Around the Circle:
  9. Repeat the process all around the board, using the spacer to maintain an even distance between nails.
  10. For the final 10 nails, adjust slightly if needed to achieve perfect even spacing. Some flexibility may be required as the circle nears completion.
  11. Alternative Methods: If you’re seeking absolute precision, you could use a protractor to mark each nail spot, but this method is quite time consuming. Another option is to print out the nail positions on paper; however, a single large print that covers the entire board avoids the hassle of aligning multiple pieces.

By following this method, you ensure that your nail layout is both uniform and efficient, don't worry about the number of nails you can always edit it in the python program.

Numbering the Nails and Removing Excess Paper

WhatsApp Image 2025-06-10 at 19.27.22.jpeg
WhatsApp Image 2025-06-10 at 19.27.21.jpeg
WhatsApp Image 2025-06-10 at 19.27.20 (1).jpeg
WhatsApp Image 2025-06-10 at 19.27.19 (1).jpeg


  1. Number the Nails: Once all the nails are uniformly placed along the inner edge of the circle, use a permanent marker or pen to number each nail on the outer side of the circle. Number them sequentially (for example, from 0 to 201) based on your project's design. This numbering will serve as a critical reference later when following your generated string art pattern.
  2. Cut Out the Excess Paper: Carefully remove the paper covering the board. Be sure to trim away all the excess paper from the areas inside the circle where the nails are positioned. Removing this inner paper is essential, it prevents any interference or hassle later when you start working with the thread and will be easier to remove at the end.


Weaving the String Art

WhatsApp Image 2025-06-10 at 19.27.19.jpeg
WhatsApp Image 2025-06-10 at 19.27.18 (2).jpeg
WhatsApp Image 2025-06-10 at 19.27.18.jpeg


  1. Follow the Nail Sequence: Open the string_art_info.txt file and locate the sequence of nail numbers. These numbers indicate the order in which you’ll connect the nails with thread.
  2. Start with the First Nail: Grab your dark polyester sewing thread and tie a firm knot at the nail corresponding to the first number in your sequence.
  3. Begin Weaving: Following the sequence, move from one nail to the next, weaving the thread between them. Work steadily and maintain consistent tension on the thread to ensure a neat and secure design.
  4. Keep a Steady Pace: Consistent tension is crucial so that the thread remains taut and doesn’t become undone during the weaving process.
  5. Work Collaboratively (Optional): For efficiency, consider working with a partner, one person can guide the thread as you weave between nails while the other reads out the nail numbers. I found this particularly helpful as it took me about 5 hours to complete the design with a partner.
  6. Monitor the Design: You don’t need to follow the entire sequence if the image begins to emerge clearly. If you continue too far, the design may become too dark or overly dense. Stop when you feel the image is sufficiently defined.

By carefully following these instructions and maintaining steady tension, you’ll transform your digital pattern into a beautiful piece of physical string art.

Securing and Revealing Your Artwork

WhatsApp Image 2025-06-10 at 19.27.17 (1).jpeg
WhatsApp Image 2025-06-10 at 19.27.16.jpeg



  1. Tie Off the Thread: Once your image clearly emerges in the intersecting threads, stop weaving and securely tie off the end of the thread. Make sure the final knot is tight and that the thread won’t unravel.
  2. Remove the Paper: Carefully peel away all the paper covering the board—including the paper beneath the threads. This step can be a bit tricky; I used a pair of tweezers to help ease out stubborn paper without disturbing the design.
  3. Admire Your Work: With all the excess paper removed, sit back and enjoy your beautiful, custom string art masterpiece!


Conclusion

WhatsApp Image 2025-06-10 at 19.27.14 (1).jpeg
WhatsApp Image 2025-06-10 at 19.27.13.jpeg
WhatsApp Image 2025-06-10 at 19.27.16 (1).jpeg

I'm not sure if I was clear enough in explaining the steps, but I think the photos will help. Also if you have any questions please don't hesitate to ask. Suggestions and corrections are appreciated. I hope you enjoyed making your own string art !