bitmap image to paint stroke g-code - part 2

A project log for If ( ) Then {Paint}

a machine to create canvas paintings of your favorite digital images

John OpsahlJohn Opsahl 08/23/2019 at 13:310 Comments

This project log is going to focus on the line scan algorithm parameters used to generate paint strokes from a bitmap image. I described the longest line selection component of the algorithm in a previous project log ( so I will not touch on it here. 

I like to think that the If Then Paint line scan algorithm is just the beginning of what is possible. There are other unique approaches to generating paint stroke lines from bitmap images that have not been explored yet. Each possible of creating unique painterly effects. Wouldn't it be great if we had a cnc painting machine platform to test out new algorithms and have multiple algorithms available in a single software package? -> Well, welcome to the If Then Paint project.

At a high level, the If Then Paint line scan algorithm works by scanning the paint brush profile size across the image at different angles, looking at whether each paint brush profile location has a high enough percentage of pixels of the scan color to be considered a valid location, then connecting adjacent valid brush profile locations into valid stroke lines. It is a computationally heavy, brute force method that has worked well so far to generate paint strokes from any bitmap image. 

The following line scan algorithm input parameters can be adjusted to create different painterly effects:

A wide range of painterly effects can be achieved with the current line scan algorithm. Someday soon I hope to get a chance to really push it's limits and explore what new paint stroke styles are possible with combinations of input parameters.