Make SIXEL color graphics supported by some terminal emulators(DECTerm/RLogin/mlterm/tanasinn/xterm)
Project description
What is SIXEL?
SIXEL is one of image formats for terminal imaging introduced by DEC VT series. SIXEL image data scheme is representation 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.
SIXEL is supported by old terminal applications, such as SAS, WordPerfect. Now netpbm and Gnuplot support this.
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.
RLogin (Japanese terminal emulator) http://nanno.dip.jp/softlib/man/rlogin/
tanasinn (Works with firefox) http://zuse.jp/tanasinn/
mlterm Works on each of X, win32/cygwin, framebuffer version. http://mlterm.sourceforge.net/
XTerm (compiled with –enable-sixel option) You should launch xterm with “-ti 340” option. the SIXEL palette is limited to a maximum of 256 colors. http://invisible-island.net/xterm/
WRQ Reflection
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
Code Example
import sixel writer = sixel.SixelWriter() writer.draw('test.png')
Dependency
Python imageloader module https://pypi.python.org/pypi/imageloader
Python Imaging Library (PIL) http://www.pythonware.com/products/pil/
Reference
Chris_F_Chiesa, 1990 : All About SIXELs ftp://ftp.cs.utk.edu/pub/shuford/terminal/all_about_sixels.txt
Netpbm http://netpbm.sourceforge.net/
It includes ppmtosixel command http://netpbm.sourceforge.net/doc/ppmtosixel.html
vt100.net http://vt100.net/
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for PySixel-0.1.1-py2.7-macosx-10.9-x86_64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96296e8abc17850982493cbb17bdd67d1c1147331cf155ae0c9ebf382cd24924 |
|
MD5 | ca2fdd284b9c17e57bdbfb0786fa3f50 |
|
BLAKE2b-256 | 7a15b149c9c2c160c274aaaf648cc32cf8fbe136823c3301697dd913692b41b1 |
Hashes for PySixel-0.1.1-py2.7-linux-x86_64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9353c4cc371d3109fc42194234abdc41b7ed325ddb4c6294ec38dd48d616ab6e |
|
MD5 | 1e2889c60e65987cfacb1ef86e70843d |
|
BLAKE2b-256 | 94943436376dc50f8257dbb54a93cc400e3a454ba7b7cb11b4f8f5606998fe12 |
Hashes for PySixel-0.1.1-py2.6-macosx-10.9-intel.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | d13db8c3635089cba8767df174f6fa86f4d8c07ec108ed7223aeadd6ce523ec2 |
|
MD5 | 8540ea7dac45d38c4335f108a1c6941f |
|
BLAKE2b-256 | 605af5b5d9d764e91bda1489e601a8540bedf9b6de9e07deb73a24817f375e5d |
Hashes for PySixel-0.1.1-py2.6-linux-x86_64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd00d512aee2b671188cd047b2251e5ae2c5e9d28d1eb59f057bd7df3f260e6e |
|
MD5 | 1d01638b7eb9e115bf8f3d910edb272f |
|
BLAKE2b-256 | cd62d1b05e2cab07972afb3cff9bfe8fcaaa3fdb971252686ee420ab505d1b10 |
Hashes for PySixel-0.1.1-py2.5-macosx-10.9-x86_64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 46b663d2cb1051bfb4d49458ba7ed8481e321613b88e05774da148eb842d659c |
|
MD5 | b9cc694ae61eb5f3252d225358ea2084 |
|
BLAKE2b-256 | 0a8dde974061bcb4fbe06f5a59e8db5fc452b01c44676448a50c3a42f25f1a3c |