Skip to content

Commit

Permalink
Merge pull request #1 from FabioKaelin/add-documentation
Browse files Browse the repository at this point in the history
Add documentation
  • Loading branch information
FabioKaelin authored Jan 4, 2023
2 parents aa671eb + 945fd7f commit 81bdd4d
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.inv.*
57 changes: 56 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,56 @@
# TerminalImage
# Terminal Image

With this package can you display a image in your terminal.

The height if the generated image is customizable.

The supported image-types are png (.png), jpeg (.jpg, .jpeg, .jfif), singleframe gif (.gif) and webP (.webp).

## Usage

To import the package use `go get github.com/fabiokaelin/terminalimage`.

```go
package main

import (
"fmt"

"github.com/fabiokaelin/terminalimage"
)

func main() {
imageString, err := terminalimage.ImageToString("img.png", 20, true)
if err != nil {
fmt.Println(err)
return
}

fmt.Println(imageString)
}

```

## Image Example

To show the convertion, here is the original image:

![Icon of the superman soundtrack on spotify](./docs/images/img.png)

The following are the converte ones:

64 pixel with pixelsplit on:

![64 Pixel with pixelsplit on](./docs/images/64-true.png)

64 pixel with pixelsplit off:

![64 Pixel with pixelsplit off](./docs/images/64-false.png)

20 pixel with pixelsplit on:

![20 Pixel with pixelsplit on](./docs/images/20-true.png)

20 pixel with pixelsplit off:

![20 Pixel with pixelsplit off](./docs/images/20-false.png)
Binary file added docs/images/20-false.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/20-true.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/64-false.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/64-true.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes

0 comments on commit 81bdd4d

Please sign in to comment.