String art from a photo: how a picture becomes thread
String art from a photo is made by reducing the image to grayscale, placing 200–300 anchor points evenly around a circle, and then having a solver greedily pick pairs of anchors and draw a straight line of thread between them. Each new line is chosen to darken whichever region of the image is still too bright. After 2,000 to 4,000 lines, the overlapping threads approximate the original photo as a single continuous monochrome line drawing. The output is not a picture but an ordered sequence of anchor-to-anchor moves — which is exactly what either a printable paper pattern or a 3D-printable G-code file then encodes.
The five things that happen between your photo and the thread
- Crop to a circle. The workspace is a disc, not a rectangle. Anything outside the circular crop is discarded before the solver sees the image.
- Convert to grayscale. Color is collapsed using a perceptual weighting (roughly 0.30 R + 0.59 G + 0.11 B), so bright reds do not flatten to the same value as muddy greens.
- Apply contrast and vignette. The image is normalised so its darkest pixels are near-black and its brightest near-white. A subtle vignette pulls focus to the centre — useful for portraits.
- Place anchors. 200–320 small points are positioned evenly around the circle. These are the only places thread is allowed to change direction.
- Solve greedily. Starting at an anchor, the solver evaluates every possible next line, scores each by how much it would reduce the remaining brightness error, and picks the best. It then subtracts that line from the target image and repeats — usually 2,500 to 3,500 times.
Nothing in this pipeline understands "face", "pet", or "subject". The solver only sees brightness. That is why a strong photo is the single biggest predictor of a clean portrait — and why no amount of solver tuning rescues a flat, low-contrast source.
What makes a photo work for the solver
Works well
- Single subject, tightly cropped to fill the circle
- Clear separation between subject and background brightness
- Soft, directional light that defines cheekbones, fur, or muzzle
- Eyes that are open, in focus, and slightly darker than skin
Fights the solver
- Group shots — every face gets a tenth of the line budget
- White subject on white wall, black pet on dark couch
- Heavy phone-camera HDR with blown highlights
- Side angles where one eye is in deep shadow
What we learned after a few thousand portraits
- The 280-anchor / 3,000-line preset is right about 80% of the time. We tried adaptive defaults; users were happier when we picked one good preset and let them nudge it than when we tried to be clever per-image.
- The number of times someone re-uploads a photo predicts satisfaction more than any solver setting. People who try two or three different photos almost always end up with a portrait they keep. People who tweak settings on a weak photo almost always do not.
- Pets generate fewer support questions than people. Pet portraits read "good" at lower fidelity because we already accept stylised animal art. A slightly off human portrait crosses uncanny-valley quickly.
- The preview is the product. The most-used button on the site is "regenerate", not "download". Most of the value of a string art generator is in seeing what your photo looks like before committing to anything physical.
Why a greedy solver and not something fancier?
A globally optimal string art solution is intractable; the search space is roughly NL for N anchors and L lines, which for a real portrait is astronomically large. Greedy solvers are not optimal but they are cheap, deterministic, and visually indistinguishable from more expensive approaches for monochrome line work. We tried simulated annealing and a beam search; both cost 10–40× the runtime for results that real users could not tell apart in a blind test. Greedy stayed.
The one place a non-greedy approach helps is the first 50 lines, which set the overall tonal balance. We bias the very early lines toward longer chords so the portrait gets its silhouette quickly; everything after that is plain greedy.
Related reading
- Turn a photo into 3D printable wall art — the end-to-end workflow once the solver has done its job.
- Best photos for personalized portrait gifts — a checklist for picking a source image.
- String art generator overview — what the tool does and what it exports.
- Printable templates vs 3D-printable files — the format choice once you have a result you like.
- Pet portrait gifts — why animals tend to print cleaner than people.
FAQ
How does a photo become string art?
A solver places anchor points around the edge of a circle, then greedily picks pairs of anchors and "draws" a straight line of thread between them, choosing each next line to darken the parts of the photo that are still too bright. After 2,000 to 4,000 lines, the overlapping threads approximate the original image as a monochrome line drawing. The output is an ordered list: line 1 connects anchor A to anchor B, line 2 connects anchor B to anchor C, and so on. That ordered list is what either a printable PDF pattern or a 3D-printable G-code file encodes.
Why does my photo look great but the string art looks muddy?
Three usual causes. First, the photo is too low-contrast — string art is monochrome line work and there is no color or fine shading to lean on. Second, the subject is too small in the frame; the solver only has a few hundred lines to spend on the face. Third, the background is busy and competes with the subject for the same dark threads. Crop tighter, increase contrast, and remove background clutter before the solver runs.
How many anchors and lines do I need for a portrait?
A face usually wants 240–300 anchors and 2,500–3,500 lines. Below 200 anchors the lines get coarse and the eyes lose definition; above 320 anchors the thread starts overlapping itself in a way that flattens contrast. Line count is a tradeoff: more lines means more shadow detail but also more visual noise in the bright areas. Start mid-range and adjust based on the preview.
Does the solver "recognise" faces?
No. The solver does not know it is looking at a face. It only sees a grayscale image and tries to match its darkness pattern with overlapping straight lines. That is why a photo with a dark subject on a bright background works well — eyes, hair, and shadow shapes naturally attract more lines — and why a flat, evenly lit photo does not.
Can I use a colour photo, or does it need to be black-and-white?
You can upload a colour photo. The pipeline converts it to grayscale before the solver runs, applying a perceptual weighting so reds and yellows do not collapse to the same brightness. You can also nudge brightness, contrast, and a vignette before generation; those happen on the grayscale image, not the original.
What kinds of photos do not work well for string art?
Group shots where each face is small. Wide landscapes with no clear focal subject. Photos with bright subjects on bright backgrounds (no contrast for the threads to bite into). Heavily filtered phone photos where the highlights are blown out. Pets photographed dark-on-dark or light-on-light. If the subject does not pop in a black-and-white print, it will not pop in string art either.
Is the on-screen preview an honest representation?
It is close, but real thread is heavier than a one-pixel line. We render the preview at a thread weight calibrated to match a typical 3D-printable extrusion, so the preview tends to undersell shadow density slightly rather than oversell it. Paper-pattern previews from other tools usually go the other way and oversell — be cautious comparing previews across generators.
How is this different from converting a photo to a 3D-printable file?
The string-art transformation is the part that turns pixels into an ordered sequence of anchor-to-anchor lines. The 3D-printing step is what then turns that sequence into G-code, frame walls, anchor pegs, and printable layers. This page is about the first half. The full end-to-end workflow, including printer choice and filament, lives in our turn-a-photo-into-3D-printable-wall-art guide.
See what your photo looks like as thread
Upload an image, watch the solver place the first few hundred lines in the browser, and decide in under a minute whether the photo will carry a portrait. No print, no commitment.