An open API service indexing awesome lists of open source software.

https://github.com/tusharhero/asciificationpy

A project to create graphics using ascii.
https://github.com/tusharhero/asciificationpy

ascii-art graphics plot plotting renderer

Last synced: 11 months ago
JSON representation

A project to create graphics using ascii.

Awesome Lists containing this project

README

          

# Asciification

My attempt to create simple images in ascii.

## asciirenderer

It uses a simple 2d list to store the characters.

## asciiplotter

Uses `asciirenderer` to plot mathematical equations.

[Try `asciiplotter` now!](https://tusharhero.github.io/asciificationpy)
### some examples

- a parabola

`code:`
```py
import asciirenderer as asc
import asciiplotter as ascp

image = ascp.plot("y == (x)**2", img= asc.createblankimg(10,10))

asc.printimage(image)
```

`output:`

```
⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛
⬛⬛⬛⬜⬛⬛⬛⬜⬛⬛
⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛
⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛
⬛⬛⬛⬛⬜⬛⬜⬛⬛⬛
⬛⬛⬛⬛⬛⬜⬛⬛⬛⬛
⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛
⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛
⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛
⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛
```

- circle

`code:`
```py
import asciiplotter as ascp
import asciirenderer as asc

image = ascp.plot("(x)**2 + (y)**2 <= 3.2**2", img=asc.createblankimg(10, 10))

asc.printimage(image)
```

`output:`

```
⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛
⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛
⬛⬛⬛⬛⬜⬜⬜⬛⬛⬛
⬛⬛⬛⬜⬜⬜⬜⬜⬛⬛
⬛⬛⬜⬜⬜⬜⬜⬜⬜⬛
⬛⬛⬜⬜⬜⬜⬜⬜⬜⬛
⬛⬛⬜⬜⬜⬜⬜⬜⬜⬛
⬛⬛⬛⬜⬜⬜⬜⬜⬛⬛
⬛⬛⬛⬛⬜⬜⬜⬛⬛⬛
⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛
```

- sine function

`code:`
```py
import asciiplotter as ascp
import asciirenderer as asc

image = ascp.plot("(y <= 2 * math.sin(x)) and (y >= 2 * math.sin(x) - 2)", img=asc.createblankimg(10, 10))

asc.printimage(image)
```

`output`

```
⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛
⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛
⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛
⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛
⬜⬜⬛⬛⬛⬛⬜⬜⬛⬛
⬜⬜⬛⬛⬛⬜⬜⬜⬜⬛
⬛⬛⬜⬛⬛⬜⬛⬛⬜⬛
⬛⬛⬜⬜⬜⬜⬛⬛⬛⬜
⬛⬛⬛⬜⬜⬛⬛⬛⬛⬜
⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛
```