A package to create ASCII art from arbitrary images. This is very much a work in progress and probably doesn’t have a purpose, but I’m finding it fun.

The core function in the package is ascii_map, which takes a path to an image file as the input, and returns a tibble converting the image to a character map:

In the code chunk above ascii_data is just a convenience function that returns the path to an image file that comes bundled with the package.

The tibble has three variables: x and y specify the location of a character on a grid, and label specifes what character is shown at that location. The package includes a simple plot function that returns a ggplot:

ascii_plot(bayes_map, charsize = 2)

There are a few other handy functions in the package. For instance, you can convert the tibble representation from ascii_map into grid of characters using ascii_grid, which returns a matrix:

Once converted to this grid format, you can write it to text file using ascii_text

Finally, for no particularly sensible reasion, the package also allows you to write the result to an HTML file that produces a “digital rain” animation.