Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bloiseleo/leagueofascii
Render your favorite champion inside your terminal :D
https://github.com/bloiseleo/leagueofascii
golang image-processing league-of-legends leagueoflegends
Last synced: 4 days ago
JSON representation
Render your favorite champion inside your terminal :D
- Host: GitHub
- URL: https://github.com/bloiseleo/leagueofascii
- Owner: bloiseleo
- Created: 2024-11-29T11:50:36.000Z (2 months ago)
- Default Branch: master
- Last Pushed: 2024-12-04T00:44:55.000Z (2 months ago)
- Last Synced: 2024-12-09T15:17:48.129Z (2 months ago)
- Topics: golang, image-processing, league-of-legends, leagueoflegends
- Language: Go
- Homepage:
- Size: 7.22 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
![]()
League of ASCII
League of Legends CLI Artist
## Getting Started
After cloning the repository with `git clone`, you can build the project using `go build .` and the executable file will be created.
Opening your terminal and executing it, you will get the following response:
```
LeagueOfASCII - Welcome to League Of Asc II
Commands:
- render: renderize a champion insde the terminal in format ASCIIUsage: /path/to/your/folder/leagueofascii.exe --flags
```
## Commands
### Render
This command will render, by default, the champion's slpash art inside your terminal using ASCII characters. If you execute `leagueofascii[.exe] render`, you will get:
```
Render, by default, the SplashScreen of the champion
Usage of render:
-champion string
Name of the champion to create the ART
-height int
New Height
-help
Help about render command
-resize
Resize the image before rendering
-square
Gets the Square Asset of the Champion
-width int
New Width
Execution time: 518.7µs
```
For example, the following command `leagueofascii render --champion Akali` renders Akali's Splash Screen. If the image is too big, it won't fit inside your terminal. But, if you want to resize it to be smaller, you can do the following `leagueofascii render --champion Akali --resize --width 90 --height 50`If you want to get the square of the champion, you can also do `leagueofascii render --champion Akali --resize --width 90 --height 50 --square`. It will provide you with a smaller version of the champion.
### Render Color
If you want to render the image with colors, you can use the `--color` flag. It'll render the entire image with all the colors.
## Features
### Negative Effect
If you want to create a negative image, you could do the following below:```go
package mainimport (
"github.com/bloiseleo/leagueofascii/leagueofascii"
"github.com/bloiseleo/leagueofascii/leagueofascii/helpers"
)func main() {
img, err := helpers.ReadJpg("./assets/poro.jpg")
if err != nil {
panic(err)
}
err = leagueofascii.GenerateNegativeImage(img, "./results/poro_negated.jpg", leagueofascii.Best_Quality)
if err != nil {
panic(err)
}
}
```
### Graysacle Effect
If you want some shades of gray, you could do the following below:
```go
package mainimport (
"github.com/bloiseleo/leagueofascii/leagueofascii"
"github.com/bloiseleo/leagueofascii/leagueofascii/helpers"
)func main() {
img, err := helpers.ReadJpg("./assets/poro.jpg")
if err != nil {
panic(err)
}
err = leagueofascii.GrayScale(img, "./results/poro_grayscale.jpg")
if err != nil {
panic(err)
}
}```
### Image to ASCII
If you want to transform your image to an ASCII art, you could do the following below:
```go
package mainimport (
"github.com/bloiseleo/leagueofascii/leagueofascii"
"github.com/bloiseleo/leagueofascii/leagueofascii/helpers"
)func main() {
img, err := helpers.ReadJpg("./assets/poro_videogame.jpeg")
if err != nil {
panic(err)
}
art := leagueofascii.CreateAscII(img)
art.Render()
}```
Besides, you can also resize the image and create an ASCII art.
```go
package mainimport (
"github.com/bloiseleo/leagueofascii/leagueofascii"
"github.com/bloiseleo/leagueofascii/leagueofascii/helpers"
)func main() {
img, err := helpers.ReadJpg("./assets/poro_videogame.jpeg")
if err != nil {
panic(err)
}
art := leagueofascii.CreateAscIIAndResize(img, 100, 100)
art.Render()
}
```
## Useful Links
- [What are Premultiplied Alpha colors?](https://shawnhargreaves.com/blog/premultiplied-alpha.html)
- [How to manipulate an image?](https://medium.com/@shubham0473/from-pixels-to-pictures-a-guide-to-image-manipulation-in-java-3647cac29ca3)