imgcat

command module
v0.0.0-...-eaacb56 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 19, 2024 License: MIT Imports: 4 Imported by: 0

README

About

GoDoc

Go port of the iTerm2 imgcat script

NOTE: requires iTerm2 2.9 or newer.

Install command line

go install github.com/martinlindhe/imgcat@latest

Use the lib in your terminal app

package main

import "github.com/martinlindhe/imgcat/lib"

func main() {
    inFile := "file.jpg"

    // using a io.Reader
	f, _ := os.Open(inFile)
	imgcat.Cat(f, os.Stdout)

    // using filename
    imgcat.CatFile(inFile, os.Stdout)

    // using a image.Image
    canvas := image.NewRGBA(image.Rect(0, 0, 20, 20))
    canvas.Set(10, 10, image.NewUniform(color.RGBA{255, 255, 255, 255}))
    imgcat.CatImage(canvas, os.Stdout)
}

License

Under MIT

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package imgcat provides helpers for embedding images (gif, png, jpeg) in the terminal output as suppored by iTerm 2.9+ and documented at https://www.iterm2.com/images.html
Package imgcat provides helpers for embedding images (gif, png, jpeg) in the terminal output as suppored by iTerm 2.9+ and documented at https://www.iterm2.com/images.html

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL