Create pencil effect drawings from pictures using R
Switch branches/tags
Nothing to show
Clone or download
Latest commit 66c9d33 Apr 25, 2018
Failed to load latest commit information.
.gitignore First commit Apr 17, 2018
LICENSE Create LICENSE Apr 24, 2018 First commit Apr 17, 2018
scribbles.R Simpler way to rearrange points Apr 21, 2018

Pencil Scribbles

In this experiment I use an algorithm to solve the Travelling Salesman Problem (TSP) to make a drawing from a picture. It is inspired by this previous one. Briefly, these are the steps:

  • Load the image
  • Transform it to gray scale
  • Obtain a sample of pixels
  • Draw the path obtained solving the TSP for sampled points

Overlapping 250 paths and giving transparency to lines (alpha) the resulting drawing has a pencil effect. For example, if you load this image:

The output is this one:

Getting Started


The code is R. You will need to install the following packages (if you don't have them already):


More info

A complete explanation of the experiment can be found at fronkonstin