go-sixel

April 3, 2026 ยท View on GitHub

DRCS Sixel Encoder/Decoder for Go

Requirements

  • Go 1.24 or later
  • A sixel-compatible terminal (see Supported Terminals)
  • ffmpeg and ffprobe (only for gosvideo)

Supported Terminals

Sixel is a bitmap graphics protocol. The following terminals are known to support sixel output:

Installation

Library

go get github.com/mattn/go-sixel

Commands

go install github.com/mattn/go-sixel/cmd/gosr@latest
go install github.com/mattn/go-sixel/cmd/gosd@latest
go install github.com/mattn/go-sixel/cmd/gosgif@latest
go install github.com/mattn/go-sixel/cmd/gosvideo@latest
CommandDescription
gosrImage renderer
gosdDecoder to PNG
goscatRender cats
gosgifRender animation GIF
gosvideoRender video via ffmpeg
goslRun SL

Usage

Render an image

$ gosr foo.png

Or from stdin:

$ cat foo.png | gosr -

Decode sixel to PNG

$ cat foo.drcs | gosd > foo.png

Render an animation GIF

$ gosgif nyacat.gif

Play a video

$ gosvideo movie.mp4
$ gosvideo -width 320 -fps 15 -loop clip.mp4
$ gosvideo -colors 255 -dither movie.mp4

gosvideo requires ffmpeg and ffprobe in your PATH. Default playback is tuned for speed with -colors 64 and dithering disabled.

Use as a library

img, _, _ := image.Decode(filename)
sixel.NewEncoder(os.Stdout).Encode(img)

License

MIT

Author

Yasuhiro Matsumoto (a.k.a mattn)