Skip to main content

Display images in the terminal

Project description

python-sixel

Display images in the terminal using Sixel.

This is a fork of the no longer maintained PySixel.

Check arewesixelyet.com for supported terminals.

Installation

PyPI release

pip install sixel

git main branch

pip install git+https://github.com/lubosz/python-sixel.git

Local copy

git clone https://github.com/lubosz/python-sixel.git
cd python-sixel
pip install -e .

Example

import sys
from sixel import converter

c = converter.SixelConverter("foo.png")
c.write(sys.stdout)

See examples directory for more examples.

sixelconv

python-sixel provides a command line tool.

Display an image in the terminal

sixelconv [options] filename

Or by using a pipe

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

Examples

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

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

sixel-0.2.0.tar.gz (19.5 kB view hashes)

Uploaded Source

Built Distribution

sixel-0.2.0-py3-none-any.whl (20.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page