Skip to main content

View full-pixel color graphics on SIXEL-supported terminals(xterm/mlterm/DECterm/Reflection/RLogin/tanasinn)

Project description

What is SIXEL?

https://raw.githubusercontent.com/saitoha/PySIXEL/data/data/sixel_gnuplot.png

SIXEL is one of image formats for terminal imaging introduced by DEC VT series. SIXEL image data scheme is represented as a terminal-friendly escape sequence. So if you want to show a SIXEL image file, all you have to do is “cat” it to your terminal.

See also more faster high quality C implementation libsixel: https://github.com/saitoha/libsixel

https://raw.githubusercontent.com/saitoha/PySIXEL/data/data/sixel_hikari.png

I heard SIXEL was supported by some old terminal applications, such as SAS, WordPerfect.

Nowadays netpbm and Gnuplot support this.

https://raw.githubusercontent.com/saitoha/PySIXEL/data/data/sixel_ls.png

Requirements

If you want to view a SIXEL image, you have to get a terminal which support sixel graphics.

Now SIXEL feature is supported by the following terminals.

Install

via github

$ git clone https://github.com/saitoha/PySixel.git
$ cd pysixel
$ python setup.py install

or via pip

$ pip install PySixel

Usage

PySixel provides a Command line tool:

$ sixelconv [options] filename

or

$ cat filename | sixelconv [options]
  • Options:

    -h, --help                                            show this help message and exit
    -8, --8bit-mode                                       Generate a sixel image for 8bit terminal or printer
    -7, --7bit-mode                                       Generate a sixel image for 7bit terminal or printer
    -r, --relative-position                               Treat specified position as relative one
    -a, --absolute-position                               Treat specified position as absolute one
    -x LEFT, --left=LEFT                                  Left position in cell size, or pixel size with unit 'px'
    -y TOP, --top=TOP                                     Top position in cell size, or pixel size with unit 'px'
    -w WIDTH, --width=WIDTH                               Width in cell size, or pixel size with unit 'px'
    -e HEIGHT, --height=HEIGHT                            Height in cell size, or pixel size with unit 'px'
    -t ALPHATHRESHOLD, --alpha-threshold=ALPHATHRESHOLD   Alpha threshold for PNG-to-SIXEL image conversion
    -c, --chromakey                                       Enable auto chroma key processing
    -n NCOLOR, --ncolor=NCOLOR                            Specify number of colors
    -b, --body-only                                       Output sixel without header and DCS envelope
    -f, --fast                                            The speed priority mode (default)
    -s, --size                                            The size priority mode

Example

View an image file:

$ sixelconv test.png

Generate sixel file from an image file:

$ sixelconv < test.png > test.six

View generated sixel file:

$ cat test.six

Show sixel in xterm

$ curl ftp://invisible-island.net/xterm/xterm-301.tgz | tar xz
$ cd xterm-301
$ ./configure --enable-wide-chars --enable-sixel-graphics --enable-256-color
$ make
# make install
$ xterm -ti vt340 -e 'sixelconv -n16 ~/testdir/test.jpg'

Code Example

import sixel
writer = sixel.SixelWriter()
writer.draw('test.png')

Dependency

Contributer

  • @cocuh (Python3 support)

Reference

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PySixel-0.1.10.tar.gz (73.8 kB view details)

Uploaded Source

Built Distributions

PySixel-0.1.10-py2.7-macosx-10.9-x86_64.egg (69.2 kB view details)

Uploaded Egg

PySixel-0.1.10-py2.7-macosx-10.4-x86_64.egg (69.6 kB view details)

Uploaded Egg

PySixel-0.1.10-py2.7-linux-x86_64.egg (187.7 kB view details)

Uploaded Egg

PySixel-0.1.10-py2.6-macosx-10.9-intel.egg (112.2 kB view details)

Uploaded Egg

File details

Details for the file PySixel-0.1.10.tar.gz.

File metadata

  • Download URL: PySixel-0.1.10.tar.gz
  • Upload date:
  • Size: 73.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for PySixel-0.1.10.tar.gz
Algorithm Hash digest
SHA256 c23271666ab2acce1483ea16902322033321eb4f7d39849b44472fa9f974d440
MD5 91aab33edeaa8a3ff3b2d6c8bfc2c9ac
BLAKE2b-256 30f6411afc87c3df52a01f6227b9f7d4fe479ea43638132a2a581635ddf0d956

See more details on using hashes here.

File details

Details for the file PySixel-0.1.10-py2.7-macosx-10.9-x86_64.egg.

File metadata

File hashes

Hashes for PySixel-0.1.10-py2.7-macosx-10.9-x86_64.egg
Algorithm Hash digest
SHA256 c161bf972e04e1e679f0867e6cbca7fe445f95df97578f41f1f3e4dccdaec45e
MD5 31a30bc4966fe4b738fd02d87d1489c2
BLAKE2b-256 0e22dd7325af7de4438b1cfef58d1e49c743e229a92e951ebdf2fa95eafa4d1a

See more details on using hashes here.

File details

Details for the file PySixel-0.1.10-py2.7-macosx-10.4-x86_64.egg.

File metadata

File hashes

Hashes for PySixel-0.1.10-py2.7-macosx-10.4-x86_64.egg
Algorithm Hash digest
SHA256 9d94cbade19f8901e1880ad3bcbd92dcb8bfd0839489be04750320c344d30d32
MD5 c9a7f2d5a37acca9cffe659863912cdd
BLAKE2b-256 963fa8d0e0de4592944ca94c8d5f0cc0be61b9e2352fb2c9f63818bba1d9ce2b

See more details on using hashes here.

File details

Details for the file PySixel-0.1.10-py2.7-linux-x86_64.egg.

File metadata

File hashes

Hashes for PySixel-0.1.10-py2.7-linux-x86_64.egg
Algorithm Hash digest
SHA256 31211a7ce1fa77a539134be41e732a066354642d6e29f2e9dbc37b64c1d58544
MD5 419e8a73486098c93277c9de16dbd9db
BLAKE2b-256 ebf1080fca935461a8af114bd4b49a06aa659d5058b6aeda01a8d04d47eb5962

See more details on using hashes here.

File details

Details for the file PySixel-0.1.10-py2.6-macosx-10.9-intel.egg.

File metadata

File hashes

Hashes for PySixel-0.1.10-py2.6-macosx-10.9-intel.egg
Algorithm Hash digest
SHA256 8414d4fea416e4e7e65f40d1703b360d4d59b409c5f58906ec30dfa5ca6600d2
MD5 90176bd3d3c38f543b9db854dcc0b7de
BLAKE2b-256 8ce5c9812c46807507b30d6031147613d1984c0c4a0d410e69c1726a7ad3fe3b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page