# Curve density over an image

I spent some time over the weekend working on an idea to accomplish this. It still needs a lot of work, but I think it has potential!

2 Likes

Very nice! Interesting use of multiple line colors.

Great results on highlights like the face and shoulder. Are you using a random walkers to pick very-nearby curve points with a probability of the next point based on the darkness of that region? The nose / lip lines around the right edge of the face aren’t quite right, but they are surprisingly disciplined for a scribble algorithm.

1 Like

Basically, I’m iterating over each pixel in the image and storing a mapped brightness value in a 2d array of 0’s and 1’s. I do this a few times for different levels of brightness, so I end up with 3 or 4 2d arrays of x,y coords.

Then, and this part clearly needs optimization, I generate millions of coordinate locations. If the coordinates are also marked as 1 in the array, I add a curveVertex to the shape. This is wasteful from a cpu perspective, but provides a lot of randomness in the sketch, which I like.

I run the algorithm a few times for varying levels of brightness and layer the curves on top of each other with a little transparency.

Still needs a lot of refinement, but I’m digging the direction thus far!

Andre 3000 from Outkast

2 Likes

Hi stirman,

Really nice work so far! love the result

I had an idea reading @jeremydouglass: maybe you can process your image in different ways to extract some key informations and use the data from all those processed image to run your algorithm.

I was mainly thinking of an “edge detection” image that could helps some lines following key features of the original picture

2 Likes

Been improving this algorithm and I bought an Axidraw (pen plotter) to draw these on paper!

5 Likes

I’m really impressed! The result is super good!

What is the dimension of your real life canvas? And how long does it take to render it (with the pen machine)?

The plotter can draw up to A3 paper size (11" x 17"), but this 2Pac plot is 11" x 11".

The plots take between 30-60 minutes, usually depending on how much I want the black saturated. Really loving making these

1 Like

Wow, I really love this project!

I haven’t read through the many links above yet, but I’m wondering if your method could be used to batch process the frames of a video to make a video of these sorts of drawings?

Not to suggest any additions to your project, of course; it’s really amazing as is!
Very inspiring work!

Thanks Dan!

Yeah, I could probably extrapolate the code to process frames of a video, but for now I’m focused on framed art as I’m showing a collection of these at a SF art show in a couple weeks

1 Like

This is very impressive. I think I’ve tried to reach out to you on reddit at some point. Would you please share info on your exhibit? I’m also in SF and would like to see your artwork in person if possible.
Thanks.

Heyo! Sorry, didn’t see the message on reddit. Here’s a link to the art show in SF, and you can see more of my scribble portraits here.

I came up with my own algorithm to do these scribbles and it’s crazy inefficient, but it still only takes ~10 seconds to draw a portrait, so I’m not stressing about it. Happy to explain the logic in more detail and have been considering writing a Medium post about it.

Would love to see you at the show and I can explain the logic in person

2 Likes

I did some work using a related approach with Processing a few years ago which produces a similar effect. Works reasonably well for some portraits but also creates quite nice architectural sketches.

(BTW, I am also the author of the Handy Processing library linked in the post above).

4 Likes

Here’s an example of applying the same technique to a building. The overshooting of the Catmull Rom splines emphasises the vanishing points of the perspective projection producing a nice ‘construction lines’ effect.

5 Likes

Beautiful, and Handy is really cool!

I tried to do something similar, but ended up getting more of a pointillistic image Think i’ll try the linear way later

1 Like

@stirman How did you do that? Have you released the code anywhere? I am adding a random jitter to a for loop, which just creates lines.

hay alguna informacion de esto? es increible!

a snapshot of results trying out the messy curve draw

1 Like

!
only let’s me upload 1 at a time

2 Likes
2 Likes