An open API service indexing awesome lists of open source software.

https://github.com/sweetbbak/lcat

Kitty graphics Go library and CLI tool for displaying images in the terminal.
https://github.com/sweetbbak/lcat

Last synced: 4 months ago
JSON representation

Kitty graphics Go library and CLI tool for displaying images in the terminal.

Awesome Lists containing this project

README

        

# lcat

A Kitty Terminal graphics CLI tool and Library.

![lcat image preview placing images in the terminal](assets/output.gif)

## The lcat CLI tool

if you are familiar with `icat` then the options are basically the exact same.

```sh
lcat --align=left img.png
lcat --place=10x10@0x0 img.png
```

## As a Library

```go

package main

import (
"log"
"os"

"github.com/jessevdk/go-flags"
"github.com/sweetbbak/lcat/icat"
)

func lcat(args []string, opt Opts) error {
var optss = &icat.Options{
Align: opt.Align,
Place: opt.Place,
ScaleUp: opt.ScaleUp,
Background: opt.Background,
Mirror: opt.Mirror,
TransferMode: opt.TransferMode,
Clear: opt.Clear,
DetectSupport: opt.DetectSupport,
DetectionTimeout: opt.DetectionTimeout,
UseWindowSize: opt.UseWindowSize,
PrintWindowSize: opt.PrintWindowSize,
Stdin: opt.Stdin,
Engine: opt.Engine,
ZIndex: opt.ZIndex,
Loop: opt.Loop,
Hold: opt.Hold,
UnicodePlaceholder: opt.UnicodePlaceholder,
Passthrough: opt.Passthrough,
ImageId: opt.ImageId,
}

_, err := icat.Icat(optss, args)
if err != nil {
return err
}
}
```

if you are using `lcat` as a library for a TUI you will want to ensure that STDIN is set to `false` otherwise garbage data will be read
on STDIN and cause an error.