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

Uploaded Source

Built Distributions

PySixel-0.1.8-py2.7-macosx-10.9-x86_64.egg (66.1 kB view details)

Uploaded Egg

PySixel-0.1.8-py2.6-macosx-10.9-intel.egg (108.2 kB view details)

Uploaded Egg

File details

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

File metadata

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

File hashes

Hashes for PySixel-0.1.8.tar.gz
Algorithm Hash digest
SHA256 66f74a82d445b1a5f1c87e5891dde97857d2bd98a6244730aff93c0ae41d243a
MD5 4f9e8d6f9bcfa8d26089d3be4119cd60
BLAKE2b-256 69a29c496290691a52cb63f0e6295e26dfe65810bdea928d355f5a73247d572b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PySixel-0.1.8-py2.7-macosx-10.9-x86_64.egg
Algorithm Hash digest
SHA256 7b38df58ed5bfecec35656ff2b736ae216e7d5c034ab7a430d2b06030fe17367
MD5 85c14e150d20e026435f2fe9ad07e5fa
BLAKE2b-256 a9105e989de3dbba3748ef04e337e7cd3a18ca376e391208ff41c2cfb561e4e4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PySixel-0.1.8-py2.6-macosx-10.9-intel.egg
Algorithm Hash digest
SHA256 868978b04867a4df7e0bd4d2abb8decfe036af8a1ce53ea6ad7c2e63146eef40
MD5 81738b174e667d6590a806fb3e56259e
BLAKE2b-256 332b32f0ec8614127a5e5d37cbd13548fcfe9e0f9e0276ef1b690195fb59cddd

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