Skip to main content

Make SIXEL color graphics supported by some terminal emulators(DECTerm/RLogin/mlterm/tanasinn/xterm)

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 heared SIXEL is 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

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 ~/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.3.tar.gz (60.7 kB view details)

Uploaded Source

Built Distributions

PySixel-0.1.3-py2.7-macosx-10.9-x86_64.egg (49.5 kB view details)

Uploaded Egg

PySixel-0.1.3-py2.7-linux-x86_64.egg (141.5 kB view details)

Uploaded Egg

PySixel-0.1.3-py2.6-macosx-10.9-intel.egg (80.8 kB view details)

Uploaded Egg

PySixel-0.1.3-py2.6-linux-x86_64.egg (141.3 kB view details)

Uploaded Egg

File details

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

File metadata

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

File hashes

Hashes for PySixel-0.1.3.tar.gz
Algorithm Hash digest
SHA256 c253882ce0e4ed99a02d2efa03c9cb281fdfeacbc57cfc74853b1155f34e4a50
MD5 6ff7024d628a8ed761c477acb2c40871
BLAKE2b-256 f39afcdbcaf53e672314c5a60313ca2cc4bcd0b870af6a12f376165d4183fdd6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PySixel-0.1.3-py2.7-macosx-10.9-x86_64.egg
Algorithm Hash digest
SHA256 02072348263b4d1869e012ccabb715615d2c2cfeed740050f48748d20354dd5e
MD5 c044be2dae8d9db4d58fcff4e2e560ee
BLAKE2b-256 08c15914ad46f13c58dea01d0752f3a94f3962a265cd41d914df290532893140

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PySixel-0.1.3-py2.7-linux-x86_64.egg
Algorithm Hash digest
SHA256 1af7f753fe72eeca9f8874b46f1eec0c9d058c45ba595819ee775b9b1c058e62
MD5 09ec1bbeef830a068ff2a2fa132b9dd2
BLAKE2b-256 43d32190e530cfa3083784fd080c831a14fbf158e09cf4005281d80842b6f9cb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PySixel-0.1.3-py2.6-macosx-10.9-intel.egg
Algorithm Hash digest
SHA256 f3d39e0f1cea790c4afc688f40b43249d21ed20d527c39a35fae5c724c2d66e3
MD5 e7281f848e860c3b732cbea030680cf6
BLAKE2b-256 fbf89b58b3f64cf9be2b90ee57fb0c317cbad509586f4f39780c2e5bf70d7446

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PySixel-0.1.3-py2.6-linux-x86_64.egg
Algorithm Hash digest
SHA256 5d123333f0a01a45441551acd56a7821908a6fb45d823996f0d8a35d79a6b8f2
MD5 5816571ce535defc9d9a4de30d36d7b6
BLAKE2b-256 4fcb697aeab03a86c23a35521d3f6aef0453a515a65b9e3f2b04255930bf5026

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