Skip to content

Repository files navigation

timg

A simple to use terminal image renderer.

  • uses unicode characters over double the width for images

TODO

[ ] determine a good pre-alloc size [ ] transparent background of image [ ] toggle between ascii only ' ' and '▀' [ ] all the ansi, ansi256 and true color have a lot of shared code

Examples

Render image as is in it's original size

var img image.Image

img = ... // load image

// render the image (turn it to a string)
// Note:  timg.Render will auto detect what color
//        profile the environment supports (using termenv)
println(timg.Render(img))

Render image but make it fit a certain size

var img image.Image

img = ... // load image

// resize image to fit in a 25x25 cell box
println(timg.Render(img, timg.FitTo(25, 25))

Other examples

see ./examples

$ cd ./examples
$ go run ./resize/main.go /path/to/your/image

References

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages