Skip to main content

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

Project description

What is SIXEL?

http://zuse.jp/misc/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.

http://zuse.jp/misc/sixel_hikari.png

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

Nowadays netpbm and Gnuplot support this.

http://zuse.jp/misc/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

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.9.tar.gz (73.7 kB view details)

Uploaded Source

Built Distributions

PySixel-0.1.9-py2.7-macosx-10.9-x86_64.egg (66.7 kB view details)

Uploaded Egg

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

Uploaded Egg

PySixel-0.1.9-py2.6-macosx-10.9-intel.egg (108.8 kB view details)

Uploaded Egg

File details

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

File metadata

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

File hashes

Hashes for PySixel-0.1.9.tar.gz
Algorithm Hash digest
SHA256 41cfc148af46f60c2697e5f07c0d5109e59450ca0e80a37e1d53d538e8406da6
MD5 2e014c41336483d2292a08ec455f3b3d
BLAKE2b-256 39e7c140a53878fed01a184c559049fd216e1757783967e89b140e46e3ae709a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PySixel-0.1.9-py2.7-macosx-10.9-x86_64.egg
Algorithm Hash digest
SHA256 5eaa1e88005a61c5b02f3e21d498c2bbd5b58840a66e16bb66a97c4b50450f91
MD5 d679321bd0e4d49aa2ef537a51124e16
BLAKE2b-256 7ad05f689fea21a74b1d0bd55d3547ff7576de18e2c5a4f6c47e62e7e6f019ae

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PySixel-0.1.9-py2.7-linux-x86_64.egg
Algorithm Hash digest
SHA256 1c6189ba532116bed83cd0f284c700b95e3629187b852686729a416856f16d97
MD5 3baacb73a3f02f4885dd5c191526c9cb
BLAKE2b-256 e0a3a8302a6cccf3c39e44675f4a0f0d4dbc50591941e13f58711c985e820743

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PySixel-0.1.9-py2.6-macosx-10.9-intel.egg
Algorithm Hash digest
SHA256 54f63c982d8f2341d9c075bb66731c7c987c6cdf615503b7e410b5d43193c771
MD5 f95a5ff47a0762b0789027a8f5a639f8
BLAKE2b-256 6e3f461acfe108227549a163037a5ba8fe41afbd77bdef6a3058f3a8146a2377

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