ebpa / drawille

Drawille library implementation in elisp.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

⢸⣭⡁⣇⡀⡇⣚⡭⢸⠭⠂⠀⣏⡱⢸⠭⡂⡮⢵⠸⡰⡸⢸⢸⣀⢸⣀⢸⣭⡁

Drawille library implementation in elisp.

This is rather a experiment for me to get started with elisp an lisp in general.

It may not use the most powerful and efficient lisp tools. I tied to document the fariables correctly and keep everything as simle as I could.

Convert a small matrix to a char

(drawille-vector-to-char [0 0
                          1 1
                          0 0
                          1 0])

Drawing a sparkline plot

(drawille-draw-sparkline nil 2 -5 4 -9 3 4 20 9 9 -4 4 9 5 3 5 7 -2 5 4)
⠀⠀⠀⡄⠀⠀⠀⠀⠀⠀
⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀
⠀⠀⢀⢿⠀⠀⠀⠀⠀⠀
⠀⠀⢸⠘⡆⢰⡀⢀⠀⠀
⠀⡄⡸⠀⡇⡇⢇⢿⢰⠄
⣇⡇⡇⠀⢸⠇⠀⠀⡏⠀
⢸⢱⠃⠀⠸⠀⠀⠀⠁⠀
⠀⢸⠀⠀⠀⠀⠀⠀⠀⠀

This can be used to draw functions curves, like this:

(defun my-sin-function () "Demo sin function."
       (cl-loop for x from 0 to 100 collect (* 10 (sin (* 0.1 x)))))

(apply 'drawille-draw-sparkline nil (my-sin-function))
⠀⠀⠀⠀⠀⠀⢀⣀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⣀⠔⠊⠁⠀⠀⠈⠉⠢⢄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠤⠊⠉⠀⠀⠀⠉⠑⠤⡀⠀⠀⠀⠀⠀⠀
⠀⡠⠊⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠑⢄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠔⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠢⡀⠀⠀⠀⠀
⠊⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠑⢄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠔⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠢⡀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠑⠢⡀⠀⠀⠀⠀⠀⠀⠀⠀⣀⠔⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠢⠄
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠒⠤⣀⣀⣀⡠⠔⠊⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀

Drawing a path

(drawille-draw-path nil '(7 4) '(3 20) '(40 9) '(0 9))
⠀⢀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠈⡎⠉⠑⠒⠤⢄⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⢣⠀⠀⠀⠀⠀⠀⠈⠉⠒⠢⠤⢄⣀⠀⠀⠀⠀⠀
⠠⠤⠬⡦⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠭⠵⠶⠦⠄
⠀⠀⠀⢣⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀

Just like sparklines, this can be used to draw functions curves, producinq a circle as an example:

(defun my-circle-function ()
  "Demo circle function."
  (cl-loop for x from 0 to 126 collect
           (list (* 20 (sin (* 0.05 x)))
                 (* 20 (cos (* 0.05 x))))))

(apply 'drawille-draw-path nil (my-circle-function))
⠀⠀⠀⠀⠀⠀⠀⠀⣀⣀⣀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⢀⡠⠔⠊⠉⠀⠀⠀⠀⠈⠉⠒⠦⡀⠀⠀⠀⠀
⠀⠀⡠⠊⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠣⡀⠀⠀
⢀⡜⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⡄⠀
⡸⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠸⡀
⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇
⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇
⠸⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡸⠀
⠀⠱⡄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡰⠁⠀
⠀⠀⠈⠦⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡠⠎⠁⠀⠀
⠀⠀⠀⠀⠈⠑⠢⠤⣀⣀⣀⣀⡠⠤⠒⠉⠀⠀⠀⠀⠀

Drawing a circle

For convenience, the circle function have been implemented.

(drawille-draw-circle nil 30 10 20)
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⣀⣀⣀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⠤⠔⠊⠉⠉⠀⠀⠀⠀⠀⠉⠉⠒⠢⣀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡤⠚⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠲⣀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⡰⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠣⡀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⢀⠎⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⣄⠀⠀
⠀⠀⠀⠀⠀⠀⡜⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⡆⠀
⠀⠀⠀⠀⠀⢸⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⠀
⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇
⠀⠀⠀⠀⠀⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡇
⠀⠀⠀⠀⠀⢇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠇
⠀⠀⠀⠀⠀⠸⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡸⠀
⠀⠀⠀⠀⠀⠀⢱⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡰⠃⠀
⠀⠀⠀⠀⠀⠀⠀⠳⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡰⠁⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠘⢢⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡠⠎⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠢⢄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠤⠊⠁⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠑⠢⠤⢄⣀⣀⣀⣀⣀⠤⠤⠒⠊⠁⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀

Convert a matrix

(setq my-grid
 (drawille-from-matrix
  [[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
   [0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0]
   [0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0]
   [0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0]
   [1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0]
   [0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0]
   [0 0 1 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 1 1 1 1 0 0 0]
   [0 0 0 1 0 0 1 1 0 0 1 1 0 0 0 0 0 1 1 0 0 1 1 0 0]
   [0 0 0 0 1 0 1 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 1 0 0]
   [0 0 0 0 0 1 0 0 0 0 0 1 1 0 0 0 1 0 0 0 0 0 1 1 0]
   [0 0 0 0 0 1 0 0 0 0 1 0 1 1 1 1 1 0 0 0 0 1 0 1 0]
   [0 0 0 0 0 1 0 0 0 1 0 0 1 1 0 1 1 0 0 0 1 0 0 1 0]
   [0 0 0 0 0 1 0 0 1 1 0 0 1 0 0 0 1 0 0 1 1 0 0 1 0]
   [0 0 0 0 0 1 0 0 1 0 0 0 1 0 0 0 1 0 0 1 0 0 0 1 0]
   [0 0 0 0 0 1 0 1 0 0 0 0 1 0 0 0 1 0 1 0 0 0 0 1 0]
   [0 0 0 0 0 1 1 0 0 0 0 0 1 0 0 0 1 1 0 0 0 0 0 1 0]
   [0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 1 0 0]
   [0 0 0 0 0 0 1 1 0 0 1 1 0 0 0 0 0 1 1 0 0 1 1 0 0]
   [0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 1 1 1 1 0 0 0]
   [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]]))
⠀⠀⠀⠀⠀⠀⢠⠒⢄⠀⠀⠀
⠑⢄⠀⣠⠤⣄⠀⠀⢀⡵⢤⡀
⠀⠀⢱⠁⢀⠜⣦⢤⡎⠀⡠⢳
⠀⠀⢸⡠⠋⠀⡇⠀⣇⠜⠁⢸
⠀⠀⠀⠳⠤⠞⠀⠀⠘⠦⠴⠃

Convert a string (current buffer)

(drawille-from-string (buffer-string) 80)
⠤⠤⠤⠤⠠⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠤⠄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠭⠭⠩⠍⠭⠭⠭⠩⠩⠭⠭⠭⠭⠍⠭⠍⠭⠩⠍⠭⠍⠭⠭⠭⠍⠬⠭⠩⠭⠬⠩⠍⠭⠭⠩⠍⠥⠭⠬⠭
⠭⠨⠭⠬⠭⠨⠩⠬⠭⠨⠭⠥⠍⠭⠩⠩⠬⠍⠈⠉⠉⠉⠉⠈⠉⠁⠉⠉⠉⠀⠁⠉⠉⠈⠁⠉⠉⠉⠉⠈
⠉⠛⠛⠛⠛⠓⠛⠛⠓⠒⠒⠒⠒⠐⡆⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⣒⡒⠒⠒⠂⠀⠀⠀⠀⠀⠀⠀⠀⠀⠁⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⣒⣐⣒⣒⣒⡐⣐⣒⡒⣒⣒⣐⡒⣂⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⣛⣛⣛⣛⣋⠉⠉⠉⠉⠉⠉⠉⠈⠉⠈⠈⠁⠁⠉⠈⠈⠈⠁⠁⠁⠉⠈⠈⠈⠈⠈⠈⠈⠁⠁⠉⠀⠀⠀⠀
⡇⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⡇⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⣒⣒⣐⣒⣐⡂⣒⣒⡐⣂⣒⣒⣐⢒⣒⡒⠒⠐⠒⠒⠒⠐⠒⠂⠒⠒⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⣉⣉⣉⢘⣛⣛⣛⣋⣛⣋⣋⣚⣓⣙⣙⡃⣛⡃⣛⣛⣛⣋⣛⣐⣂⣒⣒⠐⠂⠒⠂⠒⠒⠒⠀⠀⠀⠀⠀
⡭⣭⣭⣭⣥⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⡇⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠥⠩⠭⠭⠭⠩⠩⠭⠭⠍⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠻⣿⡯⡿⡿⡷⡯⡭⡥⡭⡭⡉⡉⡈⡉⡁⡀⡀⡀⡀⡀⡀⡀⡀⡀⡀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⢸⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⢸⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⢸⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⢸⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⡇⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⣀⣸⣇⣇⡇⠇⠇⠇⠇⠇⠇⠇⠇⠇⠇⠇⠇⠇⠇⠇⠇⠇⠇⠇⠇⠇⠿⠤⠄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⡖⣶⣶⣶⣶⣤⣤⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠇⠿⠿⠿⠿⠿⠿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⣭⣬⣭⣭⣭⣌⣬⣭⣍⣥⡭⣭⣭⣩⣬⣍⣉⣉⡀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⣭⣭⣭⣭⣥⣀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠿⠿⠿⠿⠿⠿⠟⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠛⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⣭⣬⡭⣭⣭⣌⡬⣭⣍⣤⣤⣤⣤⣠⣤⣄⢀⣀⣀⣀⢀⡀⣀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⡭⣭⣭⣭⣥⣀⣀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⡇⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⡇⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⣒⣐⣒⣒⣒⡐⣐⣒⡂⣀⣀⣀⣀⢀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⣛⣛⣓⣛⣋⠉⠁⠉⠉⠉⠉⠉⠉⠉⠉⠉⠁⠉⠉⠉⠁⠈⠁⠉⠀⠉⠈⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⣿⣿⣿⣿⣿⣿⣿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⣿⣿⣿⣿⣿⣿⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠭⠩⠭⠭⠭⠭⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⣥⣭⢥⡥⣭⢍⡭⣬⢅⣁⠉⠉⠉⠁⠉⠁⠉⠉⠉⠉⠉⠉⠈⠉⠈⠁⠉⠉⠈⠉⠉⠉⠁⠉⠉⠈⠉⠈⠉⠉
⢸⣿⢸⡇⣿⢸⡇⣿⢸⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⣸⣿⣸⣇⡿⠸⠇⠿⠸⠿⠄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⣒⣂⣒⣒⣂⡒⠒⠒⠒⠒⠒⠐⠂⠒⠐⠒⠂⠒⠒⠒⠐⠂⠒⠒⠒⠂⠒⠒⠒⠒⠒⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠉⢹⡇⣿⡠⠊⣿⢸⣇⠔⢹⡇⣿⣀⡇⠶⠦⠶⠶⠖⠂⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠈⢹⡇⣿⡠⠊⣿⢸⣇⠔⢹⡇⣿⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠭⠭⠩⠭⠡⠤⠠⠤⠤⠄⠤⠤⠠⠤⠠⠄⠤⠤⠤⠄⠤⠄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠛⣿⡏⣿⢹⡇⣶⢰⡆⣶⢰⡆⣶⣆⢒⡐⣒⡐⣒⡒⣒⢐⣒⣒⣒⢒⣀⣀⣀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⣈⣿⣇⣿⡸⠇⠿⠸⠇⠿⠸⠇⠿⠧⠄⠤⠠⠤⠠⠤⠠⠄⠤⠤⠤⠄⠤⠤⠤⠤⠤⠀⠀⠀⠀⠀⠀⠀⠀⠀
⣒⢐⣒⢒⣂⣀⣀⡀⣀⣀⣀⣀⢀⣀⣀⣀⢀⣀⢀⣀⢀⣀⡀⣀⡀⣀⣀⣀⣀⢀⣀⣀⣀⣀⣀⠀⠀⠀⠀⠀
⡭⣨⣭⣥⣩⢬⣭⡬⣭⡬⣭⣭⣥⡭⣍⢬⣭⣥⣥⢭⣭⡍⡉⣈⣉⡉⣉⡉⣉⣉⢉⣀⣀⣀⠀⠀⠀⠀⠀⠀
⠂⣿⣷⣿⣷⣿⣝⢻⣽⢶⣰⡖⣶⣖⣦⣶⣶⠴⠶⠦⠶⠶⠶⠶⠴⠶⠶⠶⠦⠶⠶⠤⠤⠤⠤⠤⠤⠤⠤⠤
⠁⠿⠿⠿⠿⠛⠛⠚⠙⠚⠛⠛⠊⠛⠚⠙⠛⠋⠚⠛⠘⠛⠋⠛⠙⠚⠛⠙⠛⠙⠛⠋⠛⠙⠛⠉⠉⠉⠉⠉

Convert an image (thanks to imagemagick)

(drawille-from-image
 "http://nicolas-petton.fr/ressources/emacs-website/images/emacs.png"
 "-resize 100x100 -dither Riemersma")
⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀⣀
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢿⡟⣿⢻⢫⢩⠫⡫⡝⢕⢝⢝⢻⢻⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⢟⠫⡫⡡⡪⢐⡣⠢⡕⡬⢪⢊⢕⢕⢕⢕⢕⢕⡪⡪⢝⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢻⡋⣕⢕⡪⡜⡔⢪⠕⠕⡕⢪⢪⢕⢕⠕⡕⠕⠕⠕⠕⠪⣜⡕⡫⣣⢹⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⡿⡟⡢⡑⢪⢐⢕⢨⢎⢌⡕⡫⢝⠪⠑⠃⠁⠁⠀⠀⠀⠀⠀⠀⠀⠀⠚⣪⣣⢣⢵⡪⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⠯⡪⢊⢜⠕⡪⡣⡑⡣⡃⢕⢪⢊⡕⣝⢕⢕⢕⠕⠕⠬⠢⠐⠀⠀⠀⠀⠀⢔⢥⡫⣪⢗⡛⢞⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⡿⡫⠪⡘⢕⢕⡣⢜⡪⡪⠈⠊⠁⠁⠀⠀⠀⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡕⣹⢜⣦⢫⡝⣳⡼⣹⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⡏⠜⡕⡪⡓⢅⢪⢕⢌⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⢀⢀⢀⠠⡀⡄⣄⢄⡤⣢⢕⣏⢼⡣⣎⠧⡹⣲⢚⡧⡿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⠭⡔⢝⠪⢎⢪⢢⢕⢕⢣⢀⠀⠀⠀⠀⠀⠀⠦⢖⢕⢧⢣⢳⢫⡞⡬⡕⣮⢜⠧⢺⡬⢧⣝⢎⢯⡭⢞⣵⢹⢳⣽⣿⣿⣿⣿
⣿⣿⣿⣟⡜⡪⡕⢜⢕⢕⢕⢕⡕⡕⡕⢕⡀⡀⠀⠀⠀⠈⠑⠓⣥⢫⣣⢗⡝⢜⠮⡱⣫⠽⡫⡼⢳⡬⡞⢳⣹⡏⣮⠞⣏⡾⣿⣿⣿⣿
⣿⣿⣿⠮⡪⡪⢜⢕⡕⡕⢕⢕⢪⢜⣪⢗⡪⡣⡣⢠⢀⠀⠀⠀⠀⠀⠂⠋⢞⡫⠯⡹⣎⢯⣭⡞⠯⣼⢹⣏⡵⢹⣺⡽⣓⣯⣿⣿⣿⣿
⣿⣿⣿⢪⢔⡜⡕⡕⢮⢪⢣⡪⣵⢣⡢⣕⡝⠬⠝⠕⠑⠓⠐⠀⠀⠀⠀⠀⠀⠀⠋⠹⢼⣓⢖⡽⣛⡧⢏⣞⣻⡭⣳⣵⡞⡞⣳⣿⣿⣿
⣿⣿⣷⢕⡥⡪⣪⢪⡫⡣⡕⣪⡜⠕⠈⠈⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⡀⣀⢀⣄⢦⡔⣳⠼⡞⢳⣳⡹⣯⣚⡱⣽⣞⣖⠽⣽⢟⣿⣿⣿
⣿⣿⣿⡗⡪⢎⠜⡕⡕⡜⡮⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⡄⢦⣲⡬⢭⣞⢯⡲⣵⡹⣼⠛⣽⣏⣳⣵⢗⢺⡯⡗⡼⣼⢻⣺⣿⣿⣿⣿
⣿⣿⣿⣏⡞⡕⢝⡮⢕⠼⠀⠀⠀⠀⠀⠀⠀⠀⠀⣤⡼⣣⣞⡳⠦⣽⡫⣲⣞⡳⣳⡹⣺⠽⣗⣳⣖⡳⡯⡯⡽⡵⣽⣞⢽⣼⣾⣿⣿⣿
⣿⣿⣿⣯⡮⣜⢵⢪⠳⡃⠀⠀⠀⠀⠀⠀⠀⠀⠼⣱⠼⣓⣦⠽⣛⢧⣳⡵⣲⠽⣓⣽⢳⡯⣞⣖⣧⢯⢗⡟⡯⣻⣵⢗⢽⣷⣿⣿⣿⣿
⣿⣿⣿⣿⣧⣕⢣⡳⣫⢝⡣⢀⠀⠀⠀⠀⠀⠀⠀⠀⠙⠃⠜⠝⠳⠭⠳⠹⠺⠽⠞⠞⡽⠭⢧⡗⣳⣯⢭⢯⣻⡺⣗⣟⣽⣾⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣮⡝⣜⢥⡳⣞⡭⢧⢢⠄⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠘⢟⣽⣮⣯⣮⣷⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣷⣚⢧⡏⢦⣏⡺⣭⣛⡧⢼⣓⢖⣢⠤⣄⢄⣠⡄⡄⣠⢤⠦⠠⠀⠀⠀⠀⠀⠀⢀⣤⡽⢵⣧⡗⣾⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣧⡹⡳⣼⢹⣲⠵⣹⢽⣚⢯⣎⠯⠗⠏⠃⠉⠁⠁⠀⠀⡀⢀⢠⢠⢖⢖⢯⢽⡵⣻⣻⢞⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣗⣧⢮⢞⡛⣧⡯⣪⢥⢄⣄⢤⡴⣒⡰⣴⣲⢗⢷⢽⢟⣽⡟⣽⣟⣻⣟⣻⣵⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣯⣏⣯⡧⢗⣧⡯⡯⣮⡟⡻⢺⣽⢗⣗⣟⣟⢽⢽⣧⢿⣺⢞⢞⣷⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣯⣾⣻⣵⢵⢻⢯⣽⢗⢟⣵⣗⣗⡿⣽⣺⣽⣯⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣿⣿⣷⣷⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿⠿

Drawing a point

(setq my-grid (drawille-draw-dot my-grid 26 35))
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠁
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⢠⠒⢄⠀⠀⠀⠀⠀
⠑⢄⠀⣠⠤⣄⠀⠀⢀⡵⢤⡀⠀⠀
⠀⠀⢱⠁⢀⠜⣦⢤⡎⠀⡠⢳⠀⠀
⠀⠀⢸⡠⠋⠀⡇⠀⣇⠜⠁⢸⠀⠀
⠀⠀⠀⠳⠤⠞⠀⠀⠘⠦⠴⠃⠀⠀

Drawing a line

(setq my-grid (drawille-draw-line my-grid  12 24  20 42))
⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠆⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⢀⠎⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⡎⠀⠀⠀⠀⠁
⠀⠀⠀⠀⠀⠀⠀⡜⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⡜⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⢠⠒⢄⠀⠀⠀⠀⠀
⠑⢄⠀⣠⠤⣄⠀⠀⢀⡵⢤⡀⠀⠀
⠀⠀⢱⠁⢀⠜⣦⢤⡎⠀⡠⢳⠀⠀
⠀⠀⢸⡠⠋⠀⡇⠀⣇⠜⠁⢸⠀⠀
⠀⠀⠀⠳⠤⠞⠀⠀⠘⠦⠴⠃⠀⠀

Principle

I use a matrix as a canvas, for performance, and so that anything that can operate on a matric can also operate on that

[[a0 a1 a2 a3 a4 a5]
 [b0 b1 b2 b3 b4 b5]
 [c0 c1 c2 c3 c4 c5]
 [d0 d1 d2 d3 d4 d5]
 [e0 e1 e2 e3 e4 e5]
 [f0 f1 f2 f3 f4 f5]
 [g0 g1 g2 g3 g4 g5]
 [h0 h1 h2 h3 h4 h5]]

And then, transforming it to this matrix of braille characters

[[[a0 a1   [a2 a3   [a4 a5  ╮
   b0 b1  / b2 b3  / b4 b5  │ One braille
   c0 c1 /  c2 c3 /  c4 c5  │ character
   d0 d1]   d2 d3]   d4 d5]]╯
 [[e0 e1   [e2 e3   [e4 e5
   f0 f1  / f2 f3  / f4 f5
   g0 g1 /  g2 g3 /  g4 g5
   h0 h1]   h2 h3]   h4 h5]]]

With the new matrix that can be written as:

[[[a0 a1 b0 b1 c0 c1 d0 d1] <- One braille character
  [a2 a3 b2 b3 c2 c3 d2 d3]
  [a4 a5 b4 b5 c4 c5 d4 d5]] <- One row of braille characters
 [[e0 e1 f0 f1 g0 g1 h0 h1]
  [e2 e3 f2 f3 g2 g3 h2 h3]
  [e4 e5 f4 f5 g4 g5 h4 h5]]] <- Two row of braille characters

Thanks

To the original drawille authors for the idea and building everything, as well as all the others that made a Drawille implementation.

To (IRC) #emacs@freenode.net, particularly:

  • forcer that for helping me finding what I could not find myself, and for advises;
  • wasamasa for its interest into this project, bringing some motivation! Also, he did this vector library that was a source of inspiaration for some functions.
  • hatschipuh for tring the library and providing this gists with implementation examples that have been used to write the rest of the library.

./drox.png

Still in progress: A library that will bring images in linux console, without graphical server like X11 and without using framebuffer, that usually require root.

So this is the kind of picture it can represent:

▓▓▓▓▓████▓▓▓██████████████████████████████████████████████████████████████████████████████████████
█▓▓▓▓█████▓▓▓█████████████████████████████████████████████████████████████████████████████████████
▓▓▓▓▓██████▓▓▓██████████████████████████████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█████████████████████████████████████
▓▓█▓▓██████▓▓▓▓████████████████████████▓█▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████████████████████████████████
████▓▓██▓▓██▓▓▓▓██████████████████████▓▓▓▓▓▓▓▓█▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓██████████████████████████████
▓█▓▓▓▓███████▓▓▓▓▓██████████████████▓▓▓▓█▓▓▓███▓▓▓▓▓▓▓▓▓▓████▓▓█▓▓▓▓▓▓███████████████▓▓███████████
▓▓▓█▓▓▓▓█████▓▓▓████████████████████▓▓▓███▓▓▓▓████▓▓██▓███████▓▓▓▓▓▓▓▓▓▓██████████████████████████
█▓▓▓▓▓▓▓██████████▓████████████████▓▓▓▓▓███████▓▓██▓█▓███▓▓▓▓▓█▓▓▓▓▓▓▓▓▓▓▓▓███████████████████████
█▓▓▓▓▓▓▓▓████████████████████████▓▓▓▓███▓██████▓▓▓▓▓▓▓█▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█████████████████████
██▓▓▓▓▓▓▓████████████████████████▓▓▓▓▓██▜▜████▓▓▓▓▓▓▓▓▓▓▓██▓███▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓██████████████████
███▓▓▓▓██▓██████████████████████▓▓▓█████▙█▓▓███▜▜████████████████▓▓▓▓▓▓▓▓██▓▓▓▓▓▓▓████████████████
████▓▓████▓█████████████████████▓▓▓██████▜██▀    ▐▚▖▄▄▄▜▜▜█████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓██████████████████
▓████▓▓▓████████████████████████▓▓▓▓████▄▛▟░            ░▐█████▓▓▓▓▓▓▓██▓▓███▓▓▓▓▓████████████████
▓██▓███████████████████████████▓▓██▓▓▓██▀░               ▐██████▓▓███▓███▓▓▓▓▓▓▓▓▓▓███████████████
▓▓▓█████████████████████████████▓███▓▓█▌                 ▐██████▓▓█████▓▓▓▓▓▓▓▓▓▓▓▓███████████████
▓▓█▓██████████████████████████████▓████▙                 ▐███████▓▓▓▓▓▓▓██▓▓▓▓▓▓▓█████████████████
████████████████████████████████▓█▓███▓█░            ▗▄█████████████████▓██▓▓▓▓▓▓███████████▓█▓███
▓█▓█████████████████████████████▓▓▓▓▓▓████▙▄▙▄▗▗ ▄▗▄███▙▓████████████▓▓▓▓██▓▓▓▓███████████████████
▓▓███████████████████████████▓▓▓▓▓▓██▓█▓██▙█▓███▌▝▜██▜▀▝▀▟██▀███████▓▓██▓▓▓███████████████████████
██████████████████████████████▓████▓███▓██▜▛▝▀░▝░ ▐██░  ░▀▝  ▟█████▓▓▓███▓████▓███████████████████
██████████████████████████████▓████▓██▙▓▓█ ░      ▐██▙    ▖▄▙██████▓▓███▀█▓█████████████████▓█████
██████████████████████████████▓▓█▓▓▓█▓▓▓▓█▙       ▝██▜▙░  ▜████████████░  ▜▓███████████████▓██████
████████████████████████████████▓▓▓▓▓▓▓▓▓▓█▌       ▐▌▗▟▙  ▜█████████▀░    ▐▓████████████████▓█████
█████████████████████████████████████▓▓▓▓▓▀▜▙   ░▚▚██▜▀▀   ▜██████▀        ▓███▓▓█████████▓▓▓▓████
██████████████████████████████████████▓▓▓▀  ▝▌  ▗ ░▛▗▙▄▄▚▜▘▐████▛░         ▐█▓▓▓▓▓▓▓▓███████▓▓█▓█▓
████████████████████████████████████▓▓▓█░       ▀▝▚▚▟▄▄█▄░ ▖███▀            ▓▓▓▓▓▓▓▓▓▓▓█████▓▓▓██▓
████████████████████████████████████▓▓▓░       ░  ▝▝▝▝▝▚▀ ▗███▀   ░▗▗▗▗▗▗▄▄▄▓▓▓▓▓▓▓▓▓▓▓▓▓████████▓
█████████████████████████████████████▓▘         ░▚▗▗▄▙▄▟█████▘░▄▙█▓▓▓▓▓▓██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█████████
█████████████████▓██████████████████▓▄▄▙▙▓▓▓▓▙▄░  ▝▜██████▓█▗▄▓▓▓▓██▓▓▓█▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████████
███████████████████████████████████▓▓▓▓▓▓▓██▓▓█▓▙▗  ▜███████▓▓▓▓██▓▓▓██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████████
███████████████████████████████████▓▓▓▓▓▓███▓▓▓▓▓▓▙▄▟██████▓▓▓███▓▓▓██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█████████
█████████████████████████████████▓▓▓▓▓▓▓████▓▓██████████▓▓▓▓███▓▓▓███▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█▓▓▓██▓▓▓██
████████████████▓▓▓█████████████▓▓▓▓▓▓▓▓████▓██████████▓▓████▓▓▓▓███▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓██▓▓▓▓▓▓▓█
███████████████▓▓▓███████████████▓▓▓▓▓▓▓██████████████▓▓██▓▓▓▓█▓███▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓██▓▓▓▓▓▓▓▓▓█
███████████████▓▀▀██▓▓▓▓▓▓▓████▓█▓▓▓▓▓▓▓██▓██████████▓▓▓██▓▓▛▀████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓▓▓▓▓▓█
█████████████▓▓▌  ░▜███▀▀▝█▓▓█████▓▓▓▓▓▓████████████▓▓██████▘▟███▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█████▓▓▓▓▓▓▓▓▓▓█
████████████▓█▝     ░▜▌ ▄███▓▓█▓███▓▓▓▓▓███████████▓▓▓████▜ ▓███████▓▓▓▓▓▓████▓▓███████▓▓▓▓▓▓▓▓▓▓█
████████████▓▙     ░  ▝█████▓▓█████▓▓▓▓▓███████████▓▓▓▓██▘▖▓█████▓██▓▓▓▓████▓▓███████▓▓▓▓▓▓▓▓▓▓▓▓█
█████▓█████▓▓▀    ░░ ▝█▚▜▛▜▓▓▓▓▓████▓▓▓▓██▓███▓██▓▓▓▓▓▓█▐▄█▓▓▓▓▓▓▓▓██▓▓███▓▓█████████▓▓▓▓▓▓▓▓▓▓▓▓▓
█▓▓█▜▜▜▓▓▓▓▓▓▗     ▝▝▀██▙▀█▓▓█▓▓████▓▓▓████▓██▓▓▓▓▓▓▓▓▓█▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓██▓▓█████████▓▓▓▓▓▓▓▓▓▓▓█▓▓
█▀░░▘▄▄▚▀  ▝▝▜░  ▖▜▚▜██████▓▓██▓████████▓██▓▓█▓▓▓▓▓▓▓▓▓▓█▓▓▓▓▓▓▓▓▓▓█▓██▓▓███████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓███
░▗▄████▜▙▄▄▗░▖▗▗   ▚█████▓▓▓████████████████▓▓▓▓▓▓▓▓▓▓▓█▓▓▓▓▓▓▓▓▓█████▓▓██████▓▓▓████▓▓▓▓▓▓▓▓▓▓▓██
████▀█▙████████▗░    ▝▝▜▜▓▓█████████████████▓▓▓▓▓▓▓▓▓▓█████▓▓█▓▓█████▓████████▓▓▓▓███▓▓▓▓▓██▓▓▓▓▓█
███▄█████████████▙▙▄▗▘░░ ░▝▀▜▓▓█▓▀▝▝▝▝▝▝▝▜█▓█▓▓▓▓▓▓▓▓███████████████▓█████▓██▓▓▓▓▓███▓▓█████▓▓▓▓▓█
██████████████████████▙▙▄▗▗░░  ░░ ▖▜▘▘ ░   ▟█▓█████▓███████████████▓██████▓███▓▓█████▓████▓▓▓▓▓▓▓█
███████████████████████████▙▙▙▄       ▗▄▄▙▙█▓████████████████████▓▓█████████████████████▓▓▓▓▓▓▓▓▓█
██████████████████████████████▙▙▙▄▄▄▙▟██████████████▓█████▓█████▓███▓█████▓████████████▓▓▓▓▓▓▓▓▓▓█
█████████▓█████▓▓██████████████▀▀▝▗▗▄▙████▓███████████████▓▓█████████▓██████████████████▓▓▓▓▓▓▓▓▓█
███████▓████▓▓▓▓▓████████████████████████▓█████████████▓▓▓███████████▓██████████████████▓▓▓▓▓▓▓▓▓█
████████▓██▓▓▓███████████████████▙▙▙▙████▓██████████▓▓██████████████████████████████████████▓▓▓▓▓█
███▓█████▓▓▓██████████████▓▓███████████▓▓██████████▓███████████████▓█████████████████████████▓▓▓▓█
█▓▓██████▓▓▓▓████████████▓▓▓▓▓▓███████▓▓▓██████████████████████████████████████████████████████▓██
██▓▓▓██▓▓▓▓▓▓█▓▓███████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█████████████████████████████████████████████████████████
█▓███████▓▓▓███▓▓██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████████████████████████████████████████████████████████
████▓▓████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓███████████████████████████████████████████████████████
████████▓▓▓█████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓██▓▓▓████████████████████████████████████████████████████████
█████████████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█▓▓█▓███████████████████████████████████████████████████████████
█████████████████████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█████████████████████████████████████████████████████████████
██████████████████████████████▓▓▓▓████████████████████████████████████████████████████████████████
██████████████████████████████████████████████████████████████████████████████████████████████████
██████████████████████████████████████████████████████████████████████████████████████████████████
█████████████████████████▓▓▓██████████████████████████████████████████████████████████████████████

One Beethoven

"                      ▄▄▙▄▄▄▙▙▓▙▙▙▄▄▄▄▙▙▙▄▗
               ▗▄▄▙▙██████████████████████▓▙▗
             ▄▓██████████████████████████████▓▙▙▄▗▗▗▗
         ▗▄▙████████████████████████▓▓█████████████▓▓▌
        ▟▓▓████▓████▓▓▓▓▓▓▓▓▓▓▓▓▓████▓▓▓▓██▓▓▓██████████▓▓▌
      ▄▓▓▓████▓▓▓███▓▓▓▓█▀▜▜█▝▝▝▝▜▜▜▜██▓████████▓▓▓▓▓▓▓▓▓▀
     ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█▛              ▝▀▀▀▀▘ ▝▝▜██▓▓▓▓▓▓▗
     ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓██▙▗                       ▝▀▜▓▜▓▓▓▌
    ▟▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████▙▗                       ▐▓
    ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓██████▌                   ▗   ▓▗
   ▖▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓██████▌                  ▖▌    ▜▙▗
   ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓████████▌   ▄▄▄▄▄▙▗▗▗  ▖▗  ░░ ▗▗▄▌██▓
   ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓█████████▛ ▚▗▟█████████▙▟ █▗   ▄██▛▄██▓▙▙▙▗
    █▓▓▓▓▓▓▓▓▓▓▓██████████▛▄▙▓▓█▓▓▓▓▓▓▓████░█▙▗▗▗█▓███████▓▀░
    ▓▓▓▓▓▓▓▓▓▓▓█████████████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓███████▓▓▓▓▓▓▓▓▗
  ░▄▓██████▓▓▓▓███████████▓▓▓▓▓▓▓▓▛▝▜▛▝▜▓▓▓███▛▀▝▐█▟█▓▓▛▜▓▘
  ▟███▓▓█████▓▓▓█████████▓▓▓▓▓▓▜▜▜▘▀▀▌▌██▛▜███▘   ▐██▐▓
  ▓████▓▓▓███▓▓▓█████████▛▝▝▘▀░▝▀▜█████▀▝  ███     ▐▗▐▌
  ▓████▓▓▓▓██▓▓▓▓█████████▙▗              ▖███░     ▖ ▓
  ▓████▓▓▓▓███▓▓▓███████████▙▗            ▐███▙░     ▜▛
  ▝▓███▓▓▓███▓▓▓▓▓████████████▙▗          ▐████▙▗    ▐▓
   ▝▓███▓▓███▓▓▓▓▓██████████████▙          ██████▙▙▄  ▓▗
     ▐▓██████▓▓▓▓▓███████████████▙         ▟████▛     ▝▓▗
      ▝▓█████▓████████████████████▙      ▖██████▗      ▟▌
       ▐▓████▓█████████████████████▌    ▄████████▙▙▄▄▄█▛
        ▐▓███▓▓█████████████████████▙▗▄████▓▓▓▓▓▓▓▓▓▓▓▀  ▄▄▗
          ▝▓██▓▓▓█████████████████████████▓▓▓▓▓▓▓▓▓▓▓▓▙▗ ▐▓▓▗
           ▝▓███▓▓▓████████████████████▓▓▓▓▓▓▓▓▓▓▓▓▓▓██▓▙█▓█▓
            ▝▓████▓▓▓█████████████████▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓█████▓▛
             ▐██████▓▓▓██████▓▓▓█▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▀
             ▝▓███████▓▓▓████████▓█▓▓▓▓▓▓▓▓▓▓▓▓███▓▜▀▜▓▓▜▀
              ▓████████▓▓▓▓████████████████████████▌
              ▐███████████▓▓▓▓▓███████████████████▓▘
              ▝▓█████████████▓▓▓▓▓▓▓▓▓████▓▓███▜▜▀
              ░▓████████████████▓▓▓▓▓▓▓▓▓▓▓▌
              ▓██████████████████████████▓▛
            ▖▓███████████████████████████▛
            ░▓██████████████████████████▛
             ▝▜▓████████████████████████▌
               ░▝▜█████████████▀       ▐▓
                  ▝▜▓█████████░       ▜▌▓░
                     ▝▜██████▛      ░▚█▘▐▌
                       ▝▀▓███▘           ▓░
                          ▝▜▙▗           ▐▌
                            ░▝▚▄░         ▓▗
                               ▝▜▚▗       ▐▌
                                  ▝▚▙▗    ▐▌
                                    ▝▜▙▗  ▐▙
                                      ▝▜▙░▄▓

One leningen

This does not produce the exact same thing as drawille. Try this…

(drox-from-matrix
 [[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
  [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
  [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]
  [0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0]
  [0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0]
  [0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0]
  [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0]
  [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0]
  [0 1 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 1 1 1 1 0 0 0]
  [0 0 1 0 0 1 1 0 0 1 1 0 0 0 0 0 1 1 0 0 1 1 0 0]
  [0 0 0 1 0 1 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 1 0 0]
  [0 0 0 0 1 0 0 0 0 0 1 1 0 0 0 1 0 0 0 0 0 1 1 0]
  [0 0 0 0 1 0 0 0 0 1 0 1 1 1 1 1 0 0 0 0 1 0 1 0]
  [0 0 0 0 1 0 0 0 1 0 0 1 1 0 1 1 0 0 0 1 0 0 1 0]
  [0 0 0 0 1 0 0 1 1 0 0 1 0 0 0 1 0 0 1 1 0 0 1 0]
  [0 0 0 0 1 0 0 1 0 0 0 1 0 0 0 1 0 0 1 0 0 0 1 0]
  [0 0 0 0 1 0 1 0 0 0 0 1 0 0 0 1 0 1 0 0 0 0 1 0]
  [0 0 0 0 1 1 0 0 0 0 0 1 0 0 0 1 1 0 0 0 0 0 1 0]
  [0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 1 0 0]
  [0 0 0 0 0 1 1 0 0 1 1 0 0 0 0 0 1 1 0 0 1 1 0 0]
  [0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 1 1 1 1 0 0 0]
  [0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0]])

Or simply make an image with this:

(drox "path/to/any/type/of/image" "-e xtra -arg for imagemagick")

About

Drawille library implementation in elisp.

License:Do What The F*ck You Want To Public License


Languages

Language:Emacs Lisp 100.0%