Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Sketcher: Program draws pictures

Loading...

Sign in or sign up now!
11,458
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Jun 18, 2009

This is a computer program I made that attempts to imitate the way an artist would draw an image with a pencil.

description for the mathematically inclined:
The program simply follows the perpendicular of the first order approximation of the image gradient of the pixel intensities. Every path containing a high number of high intensity gradients is stored as a stroke. These strokes are ranked in order of "goodness", that is a function of both the length and intensity of that stroke. The pencil then shades these strokes in around the image, starting with the strong strokes, and going towards the light strokes at the end. Strokes that are close to each other are likely to be drawn consecutively for more pleasing visual effect.

made using python (with pygame library)

  • likes, 4 dislikes

Link to this comment:

Share to:

Uploader Comments (badmephisto)

  • Let me guess: you use an edge-detection algorithm to generate points, then use a clustering algorithm to groups nearest neighbors, then for each cluster, you use a graph-search algorithm to trace the path of the virtual pencil?

  • @RaminHAL9001 wow that's waay too difficult and probably wouldn't work. I start at an unvisited point with high gradient and follow it while drawing until it gets below threshold. Then I repeat until all is visited.

  • This is really impressive!

    A few of questions.

    Firstly, why did you choose to create this in python? And how do you calculate the image gradient? I have a rough idea, but am not sure.

    Also, what graduate work are you doing?

  • thank you.

    I did this in Python because it is my main, favorite programming language. I am very efficient at it. Gradient is a vector (dx, dy) for every pixel L(x,y) st. (in the first order approximation), dx=L(x+1,y)-L(x-1,y), dy=L(x,y+1)-L(x,y-1)

    I'll be doing grad work in Computer Graphics and AI.

  • Do you read Python books and learn from them and make programs like this one?! Plz tell me which python book you use. I'm learning Python as my second programming language and I want to learn how to make real cool program like yours. I'm just wondering if you have a good book...

  • no i didnt read a single python book, and i dont have python books. I got introduced to Python in one of my university classes, and everything i've learned is just through making LOTS and LOTS of simulations and games in my spare time, and looking at a lot of example code

Top Comments

  • Nice :D The computer programs are getting better and better :D

  • If you ever re-do this, you should add a condition that makes it so dimmer lines are only drawn if they aren't close to bold ones. This is because the end product looks more like the image ran through the "find edges" algorithm, by fault of the dimmer and closer lines. You are a great programmer and I hope you make more creations :D

see all

All Comments (99)

Sign In or Sign Up now to post a comment!
  • How can I get this software?

  • Must be the car that you would buy next time

  • @badmephisto "wow that's waay too difficult and probably wouldn't work" Well, your method is quite clever. Just start at a high-gradient point, I don't think I would have thought of that myself. The method I mentioned would work, you would need some extra code to make sure all points were visited, and the algorithm itself might be no more than 4 lines of Matlab code. But I should do less talking and more implementing!!!

  • Any chance you could put this up as source code as well? I'd like to take a look at it.

  • What a bad person have to be to dislike this...

  • You have a beautiful mind.

  • @ILCAC3 docs.python.org

  • please please could you release it to the public!! it looks like such an amazing program!!

View all Comments »
Loading...

0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more