• Stars
    star
    170
  • Rank 223,357 (Top 5 %)
  • Language
    Python
  • License
    GNU General Publi...
  • Created about 12 years ago
  • Updated almost 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

pysixel

What is SIXEL?

https://raw.githubusercontent.com/saitoha/PySIXEL/data/data/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.

See also more faster high quality C implementation libsixel: https://github.com/saitoha/libsixel

https://raw.githubusercontent.com/saitoha/PySIXEL/data/data/sixel_hikari.png

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

Nowadays netpbm and Gnuplot support this.

https://raw.githubusercontent.com/saitoha/PySIXEL/data/data/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

Contributors

  • @cocuh (Python3 support)

Reference

More Repositories

1

libsixel

A SIXEL encoder/decoder implementation derived from kmiya's sixel (https://github.com/saitoha/sixel).
C
2,390
star
2

Haisyo

拝承 / hΓ‘i ΚƒΓ³u / hyper-context O.K.'ing protocol
C
105
star
3

sixel

Mirror of "sixel" original version (kmiya's sixel). The origin of libsixel.
C
58
star
4

xserver-SIXEL

A X server implementation for SIXEL-featured terminals, based on @pelya's Xsdl kdrive server(https://github.com/pelya/xserver-xsdl)
C
57
star
5

trachet

Tell you what is happening on your terminal
Python
54
star
6

SDL1.2-SIXEL

SDL 1.2 with libsixel based video driver
C
49
star
7

tanasinn

δΈ‰ ┏( ^o^)β”› < Terminal emulator extension for Firefox / Thunderbird / SeaMonkey.
JavaScript
47
star
8

rxvt-unicode-sixel

sixel graphics integration for rxvt-unicode(urxvt)
C
32
star
9

sentimental-skk

δΈ‰ δΈ‰ ( Β΄_ゝ`οΌ‰οΌœ Japanese Input Method SKK (Simple Kana to Kanji conversion) on your terminal
Python
27
star
10

tff

Terminal Filter Framework: Provides basic interfaces for terminal I/O filter applications, and exports some default implementations such as Scanner, Parser ...etc.
C
19
star
11

xserver-xsdl-SIXEL

Xsdl kdrive server(https://github.com/pelya/xserver-xsdl) for SDL1.2-SIXEL(https://github.com/saitoha/SDL1.2-SIXEL)
C
14
star
12

canossa

Provides basic, transparent, off-screen(invisible) terminal emulation service, for terminal apps.
Python
12
star
13

PyDRCS

Make DRCS(Soft Character Set) glyphs for some terminals(DEC VT-series, RLogin, tanasinn, mlterm) from image files
Python
10
star
14

libsixel-perl

C++
7
star
15

zuse

A ecmascript like interpreter. supports x86 jit and IActiveScriptParse integration.
C++
6
star
16

eck

A fork of cygwin ck terminal emulator
C++
5
star
17

termprop

detects some terminal glitches and advanced facilities information
Python
5
star
18

libsixel-python

Python
4
star
19

aPSL

aPSL
C++
3
star
20

sixelterm

Display JPEG/PNG image with cat command, on some terminal supports SIXEL (RLogin/mlterm/tanasinn). Inspired by GateOne.
Python
3
star
21

heart-sutra-mac

The Prajnaparamita-Hridaya Sutra on Mac
Shell
2
star
22

ImageMagick-V7-SIXEL

Experimental fork of ImageMagick with SIXEL support
C
2
star
23

libsixel-ruby

C
2
star
24

drcsterm

DRCSTerm aims at reviving the DRCS(Dynamically Redefined Character Set) feature to the Terminal World.
Python
2
star
25

ImageMagick-SIXEL

An experimental fork of ImageMagick with SIXEL support (This repo is dead. SIXEL support is merged into upstream already)
C
2
star
26

cairo

C
1
star
27

jacot

jacot - Japanese Auto character encoding COnversion on Tty
Python
1
star
28

NeHe-SIXEL

SIXEL port of NeHe lessons
Shell
1
star
29

libsixel-php

C
1
star