petal is a Go program that lets you display images directly in the terminal from either local images or web URLs.
It supports:
png(also works with transparent png)jpg/jpeggif
The image source can be local or remote, so you can point it at a file on disk or an image from the internet.
We devide each line into 2 rows of pixels using "▄" charector. For the top pixel we color with by modifying the background charector and for the second pixel, we change the forground color.
The examples folder includes sample output for the main supported cases:
Run the program with a local path or a web URL:
go run . <image-path-or-url>Example:
go run . https://forum.playhive.com/uploads/default/original/3X/9/f/9fbb4321b65bdf33a08df00b50a6e34c3d1e98df.gifYou can also build the binary first:
go build -o petal.exe
./petal.exe <image-path-or-url>If you want to control the terminal size used for rendering, pass columns and rows:
go run . <image-path-or-url> <cols> <rows>Example:
go run . examples/example3.png 80 24


