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.
- Host: GitHub
- URL: https://github.com/tusharhero/asciificationpy
- Owner: tusharhero
- License: gpl-3.0
- Created: 2022-09-20T10:25:52.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-12-16T13:48:25.000Z (about 3 years ago)
- Last Synced: 2025-02-05T09:16:50.412Z (about 1 year ago)
- Topics: ascii-art, graphics, plot, plotting, renderer
- Language: Python
- Homepage: https://tusharhero.xyz/asciificationpy
- Size: 1.24 MB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
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`
```
⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛
⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛
⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛
⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛
⬜⬜⬛⬛⬛⬛⬜⬜⬛⬛
⬜⬜⬛⬛⬛⬜⬜⬜⬜⬛
⬛⬛⬜⬛⬛⬜⬛⬛⬜⬛
⬛⬛⬜⬜⬜⬜⬛⬛⬛⬜
⬛⬛⬛⬜⬜⬛⬛⬛⬛⬜
⬛⬛⬛⬛⬛⬛⬛⬛⬛⬛
```