• Stars
    star
    835
  • Rank 54,605 (Top 2 %)
  • Language
    Go
  • License
    MIT License
  • Created over 7 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

CLI app to convert ASCII arts into hand drawn diagrams.

Diagram

Go Reference build Go Report Card license

Diagram is a full fledged CLI application to generate hand drawn diagrams from ASCII art.

screencast

Installation

In order to run the application please make sure that Go is installed on your local machine and check if $GOPATH/bin is included into the PATH directory.

Run the following commands to download the project and build the executable.

$ git clone https://github.com/esimov/diagram
$ cd diagram
$ go build

# Start the application
$ diagram

Notice: The tool requires the glfw graphic library, so make sure that it is installed on your local machine.

For a full list of the required external dependencies check the official documentation of go-glfw (https://github.com/go-gl/glfw/blob/master/README.md).

Build

A shell script is bundled into the library to mitigate the generation of binary files for the most widespread operating systems, but take care: different dependencies are needed for different operating systems. To build the executable file run:

$ make all

Usage

Once you are inside the terminal application you can create, edit or delete the ASCII diagrams. By pressing CTRL+d you can convert the ASCII art into a handwritten diagram. The generated PNG file will be saved into the output folder relative to the current path.

Command Line support

The application also supports the generation of hand drawn diagrams directly from command line without to enter into the CLI application.

$ diagram --help will show the currently supported options:

β”Œβ”¬β”β”¬β”Œβ”€β”β”Œβ”€β”β”¬β”€β”β”Œβ”€β”β”Œβ”¬β”
 β”‚β”‚β”‚β”œβ”€β”€β”‚ β”¬β”œβ”¬β”˜β”œβ”€β”€β”‚β”‚β”‚
β”€β”΄β”˜β”΄β”΄ β”΄β””β”€β”˜β”΄β””β”€β”΄ β”΄β”΄ β”΄
    Version: 1.0.4

CLI app to convert ASCII arts into hand drawn diagrams.

  -font string
    	Path to the font file (default "/Users/esimov/Projects/Go/src/github.com/esimov/diagram/font/gloriahallelujah.ttf")
  -in string
    	Source
  -out string
    	Destination
  -preview
    	Show the preview window (default true)

CLI Examples

Read input from sample.txt and write image to sample.png showing a preview window with the hand drawn diagram:

diagram -in sample.txt -out sample.png

Read input from sample.txt and write image to sample.png, and exit immediately without showing a preview window:

diagram -in sample.txt -out sample.png -preview=false

Generate diagram as above but use a font at a different location:

diagram -in sample.txt -out sample.png -preview=false -font /path/to/my/font/MyHandwriting.ttf

Key bindings

Key Action
Tab Next Panel
Shift+Tab Previous Panel
Ctrl+s Open Save Diagram Modal
Ctrl+s Save Diagram
Ctrl+d Convert Ascii to PNG
Ctrl+x Clear the editor content
Ctrl+z Restore the editor content
PageUp Jump to the top
PageDown Jump to the bottom
Home Jump to the line start
End Jump to the line end
Delete/Backspace Delete diagram
Ctrl+c Quit

Example

Input Output

The application was tested on Ubuntu, MacOS and Windows.

Acknowledgements

The ASCII to PNG conversion was ported from shaky.dart.

Dependencies

Author

License

Copyright Β© 2017 Endre Simo

This project is under the MIT License. See the LICENSE file for the full license text.

More Repositories

1

caire

Content aware image resize library
Go
10,356
star
2

pigo

Fast face detection, pupil/eyes localization and facial landmark points detection library in pure Go.
Go
4,386
star
3

triangle

Convert images to computer generated art using delaunay triangulation.
Go
2,038
star
4

stackblur-go

A fast, almost Gaussian Blur implementation in Go
Go
256
star
5

dithergo

Various dithering algorithms implemented in Go
Go
167
star
6

forensic

Copy-move image forgery detection library.
Go
136
star
7

gobrot

Mandelbrot image renderer in Go
Go
105
star
8

gogu

A comprehensive, reusable and efficient concurrent-safe generics utility functions and data structures library.
Go
97
star
9

colorquant

Go library for color quantization and dithering
Go
85
star
10

legoizer

A tool to convert images to Lego bricks.
Go
80
star
11

ascii-fluid

Terminal based ASCII fluid simulation controlled by your webcam. 🌊
Go
66
star
12

colidr

Coherent Line Drawing implementation in Go.
Go
55
star
13

pigo-wasm-demos

Webassembly demos showcasing the Pigo face detection library.
Go
53
star
14

gifter

Gif image renderer running in terminal.
Go
44
star
15

gospline

Implementing b-spline curves in Go
Go
37
star
16

cloth-physics

Desktop application for cloth physics simulation using Gio GUI.
Go
37
star
17

triangle-app

Desktop application for Triangle.
JavaScript
35
star
18

pigo-face-tracking

Play games with your head. A face tracking application using the Pigo library.
Go
27
star
19

asciibrot

ASCII mandelbrot fractal running in terminal
Go
22
star
20

facemask

Overlay a mask over a person's face
Go
17
star
21

pigo-openfaas-faceblur

OpenFaaS faceblur function using the Pigo face detector library. (https://github.com/esimov/pigo)
Go
17
star
22

minecraft.js

Simplex noise based minecraft map generator
JavaScript
17
star
23

caire-openfaas

OpenFaaS function for Caire, the content aware image resize library. (https://github.com/esimov/caire)
Go
13
star
24

pigo-openfaas

OpenFaaS function for face detection using the Pigo library. (https://github.com/esimov/pigo)
Go
12
star
25

openfaas-coherent-line-drawing

Coherent Line Drawing OpenFaaS function based on https://github.com/esimov/colidr
Go
11
star
26

gomp

Alpha compositing operations and blending modes in Go.
Go
10
star
27

pigo-gocv-benchmark

Pigo vs GoCV face detection benchmark comparison
Go
4
star
28

simplexnoise.js

Javascript simplex noise implementation based on Stefan Gustavson paper: http://webstaff.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf
JavaScript
3
star
29

homebrew-triangle

Brew formula for Triangle.
Ruby
2
star
30

go-arena

Testing and benchmarking the new experimental Go memory arenas.
Go
2
star
31

talks

Talks I have given
TeX
1
star
32

flash-experiments

Old Flash (ActionScript3) experiments
ActionScript
1
star