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

README.md

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

Prerequisites

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

install.packages("imager")
install.packages("dplyr")
install.packages("ggplot2")
install.packages("scales")
install.packages("TSP")

More info

A complete explanation of the experiment can be found at fronkonstin

Authors