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

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

Uploaded Source

Built Distributions

PySixel-0.1.7-py2.7-macosx-10.9-x86_64.egg (51.2 kB view details)

Uploaded Egg

PySixel-0.1.7-py2.7-linux-x86_64.egg (142.7 kB view details)

Uploaded Egg

PySixel-0.1.7-py2.6-macosx-10.9-intel.egg (83.3 kB view details)

Uploaded Egg

PySixel-0.1.7-py2.6-linux-x86_64.egg (142.7 kB view details)

Uploaded Egg

File details

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

File metadata

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

File hashes

Hashes for PySixel-0.1.7.tar.gz
Algorithm Hash digest
SHA256 bd69c6956de028b68be309c357e68ea16495c293246440335e2122c0857399ad
MD5 12515bd11a25630e9ba4b5466c753da5
BLAKE2b-256 a958d63e95c83868790eb5f62880dfa53721c935701c9ed5b9e249613f1cca2f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PySixel-0.1.7-py2.7-macosx-10.9-x86_64.egg
Algorithm Hash digest
SHA256 ec0b65eca34fcfd292551a1f5506a757f841e8d93f7f1cf4986f5efca0c31fc5
MD5 b1b184d5929cb411b38b44a504a66054
BLAKE2b-256 a989a936f10dc640a14e2a080de17db6ccc1392438250543d93dee300295cdd4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PySixel-0.1.7-py2.7-linux-x86_64.egg
Algorithm Hash digest
SHA256 5f3fd13fc111bb32b1b349a6692261987f1e16a4970a939225700dd63785396d
MD5 0cf686f12fdc45e1aa4d0c073b89cd70
BLAKE2b-256 f9fbd5b241336a979434db9c8affe67fbaeb50c193c04f3e53b24e3bc647b23c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PySixel-0.1.7-py2.6-macosx-10.9-intel.egg
Algorithm Hash digest
SHA256 ae37a86d391c19c167e524555cb605f8e903027e4fe8ccc30ddfb3e6f584b709
MD5 c429ca0bd37268980cb44ceb78074316
BLAKE2b-256 323ce747a7f11b95fc91123ebace5d8c89ffcad7a0ceedf314dbed976cafdebb

See more details on using hashes here.

File details

Details for the file PySixel-0.1.7-py2.6-linux-x86_64.egg.

File metadata

File hashes

Hashes for PySixel-0.1.7-py2.6-linux-x86_64.egg
Algorithm Hash digest
SHA256 75b9e018b90b86bffead418c3fc157e547365da9cfcb8d4c2ced2f0a5534b099
MD5 011c81f6d8926052407cce5dfc66b356
BLAKE2b-256 a35d4623eb3c447efa7b77d7d11aeee2a01d9922d381948078756e9fe874b657

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