Draw images in your ANSI terminal with true color
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
ansimage Fetch images from HTTP/HTTPS Jul 3, 2018
vendor Little fixes for piping functionality Feb 27, 2018
.gitignore In the beginning, Author released the source code and .gitignore Feb 8, 2017
LICENSE.txt In the beginning, Author released the source code and .gitignore Feb 8, 2017
README.md Fetch images from HTTP/HTTPS Jul 3, 2018
glide.lock Little fixes for piping functionality Feb 27, 2018
glide.yaml Added image transparency support Feb 11, 2017
pixterm.go Fetch images from HTTP/HTTPS Jul 3, 2018
screenshot01.png Fetch images from HTTP/HTTPS Jul 3, 2018
screenshot02.png New Dithering Mode and updated vendor libraries packages Dec 16, 2017
screenshot03.png New Dithering Mode and updated vendor libraries packages Dec 16, 2017
screenshot04.png New Dithering Mode and updated vendor libraries packages Dec 16, 2017
screenshot05.png New Dithering Mode and updated vendor libraries packages Dec 16, 2017
screenshot06.png New Dithering Mode and updated vendor libraries packages Dec 16, 2017
screenshot07.png New Dithering Mode and updated vendor libraries packages Dec 16, 2017
screenshot08.png New Dithering Mode and updated vendor libraries packages Dec 16, 2017
screenshot09.png New Dithering Mode and updated vendor libraries packages Dec 16, 2017
screenshot10.png New Dithering Mode and updated vendor libraries packages Dec 16, 2017
screenshot11.png New Dithering Mode and updated vendor libraries packages Dec 16, 2017
screenshot12.png New Dithering Mode and updated vendor libraries packages Dec 16, 2017

README.md

   ___  _____  ____
  / _ \/  _/ |/_/ /____ ______ _    Made with love by Eliuk Blau
 / ___// /_>  </ __/ -_) __/  ' \   github.com/eliukblau/pixterm
/_/  /___/_/|_|\__/\__/_/ /_/_/_/   v1.2.4

PIXterm - draw images in your ANSI terminal with true color

PIXterm shows images directly in your terminal, recreating the pixels through a combination of ANSI character background color and the unicode lower half block element. If image has transparency, an optional matte color can be used for background. Also, you can specify a dithering mode; in which case, the image is rendered using block elements with different shades, or using standard ASCII characters in the same way. In dithering mode, the matte color is used to fill the background of the blocks or characters.

The conversion process runs fast because it is parallelized in all CPUs.

Supported image formats: JPEG, PNG, GIF, BMP, TIFF, WebP.

Fetching images from HTTP/HTTPS is supported too.

Cool Screenshots

No Dithering (Classic Mode)

Screenshot 1

Screenshot 2

Screenshot 3

Screenshot 4

Screenshot 5

Screenshot 6

Dithering with Blocks

Screenshot 7

Screenshot 8

Screenshot 9

Dithering with Characters

Screenshot 10

Screenshot 10

Screenshot 10

Requirements

Your terminal emulator must be support true color feature in order to display image colors in a right way. In addition, you must use a monospaced font that includes the lower half block unicode character: ▄ (U+2584). I personally recommend Envy Code R. It's the nice font that shows in the screenshots. If you want to use the dithering mode with blocks, the font must also includes the following unicode characters: █ (U+2588), ▓ (U+2593), ▒ (U+2592), ░ (U+2591). The dithering mode with characters works with standard ASCII chars.

Dependencies

All dependencies are directly included in the project via Go's Vendor Directories. You should not do anything else. Anyway, if you want to get the dependencies manually, project uses the Glide Vendor Package Management. Follow its instructions.

Dependencies for PIXterm CLI tool
  • Package colorful: github.com/lucasb-eyer/go-colorful
  • Package terminal: golang.org/x/crypto/ssh/terminal
Dependencies for ANSImage Package
  • Package colorful: github.com/lucasb-eyer/go-colorful
  • Package imaging: github.com/disintegration/imaging
  • Package webp: golang.org/x/image/webp
  • Package bmp: golang.org/x/image/bmp
  • Package tiff: golang.org/x/image/tiff

Installation

You need the Go compiler version 1.7 or superior installed in your system.

Run this command to automatically download sources and install PIXterm binary in your $GOPATH/bin directory:

go get -u github.com/eliukblau/pixterm

If you use Arch Linux, eigengrau has kindly created an AUR package for PIXterm (thanks man!). Run this command to install it:

yaourt -S pixterm-git

About

PIXterm is a terminal toy application that I made to exercise my skills on Go programming language. If you have not tried this language yet, please give it a try! It's easy, fast and very well organized. You'll not regret :D

This application is originaly inspired by the clever termpix, implemented in Rust.

The dithering mode is my own port of the Processing Textmode Engine's render.

License

Mozilla Public License Version 2.0

Contributors

  • @disq - Original code for image transparency support.
  • @timob - Fix for ANSIpixel type: use 8bit color component for output.
  • @HongjiangHuang - Original code for image download support.