Sketcher: Program draws pictures

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)

Duration : 0:5:2


[youtube 6LmQS4DJl6c]

This entry was posted in picture images and tagged , , , , , , , , , , , , , . Bookmark the permalink.

25 Responses to Sketcher: Program draws pictures

  1. cliftut says:

    Heh, some artists …
    Heh, some artists could probably learn a few things by watching this robot.

  2. ILCAC3 says:

    Now computers are …
    Now computers are now competiting with artist… will there be an end with their (programmers) creativity?!

  3. Blacklemon67 says:

    If you ever re-do …
    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

  4. Blacklemon67 says:

    programmers don’t …
    programmers don’t code in binary, one should know binary if file operations are involved (or compression algorithms, or cyphers or really anything I guess)

  5. JASONE1986 says:

    this is way better, …
    this is way better, in robot its just a cgi trick this is realtime

  6. gahjii says:

    can you make like …
    can you make like the one in iRobot

  7. gahjii says:

    yeah, the artist …
    yeah, the artist will find it inefficient if he/she is going to use this process

  8. dogsoldier111 says:

    Nice computer …
    Nice computer program. what music is that playing in teh background ?

  9. YoinkinatorX says:

    Nice dude!

    I think …
    Nice dude!

    I think an artist bases the order of strokes by length instead of strength. Usually, longer strokes come first, then details, then weight, if you know what I mean.

    Nice program though! If you could make this a robot, you could be rich!

  10. drugdrunkker says:

    where can i …
    where can i download this??

  11. adrianGGO says:

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

  12. yopani says:

    ur videos are great …
    ur videos are great! I’ve learned a lot from ur rubik’s tutorials, hope u can make prog. tutorials too..tnx!

  13. amutantturtle says:

    My mind has just …
    My mind has just been blown

  14. TOMANDKATIE says:

    WOW! You binary …
    WOW! You binary code freaks are insane! -In a good way! now I know why it took 20 years to make a full-blown TRANSFORMERS movie!

  15. llamasownyou says:

    That is truly …
    That is truly awesome!

  16. ILCAC3 says:

    What confusing …
    What confusing codework.

  17. ILCAC3 says:

    Then can you tell …
    Then can you tell me what you learn at least, I really want to make cool programs like you -___- Can you send at least message including the sample code, and some important code from some of your programs?! I’m not trying to steal it, dont worry… just studying thats all. xD HOPE YOU DO.

  18. badmephisto says:

    no i didnt read a …
    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

  19. ILCAC3 says:

    Do you read Python …
    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…

  20. terrapin52 says:

    good solves!
    good solves!

  21. DavidAdams123456 says:

    Amazing!
    Amazing!

  22. badmephisto says:

    thank you.
    I did …

    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.

  23. ninjakannon says:

    This is really …
    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?

  24. badmephisto says:

    i precompute all …
    i precompute all strokes and then play them at any speed i like…

  25. 555tHeNaMeleSs666 says:

    Very impressive! …
    Very impressive! Does the program “draw” at this speed or is it sped up or slowed down?