GithubHelp home page GithubHelp logo

urufusan / python-sixel Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lubosz/python-sixel

0.0 0.0 0.0 2.7 MB

Display images in the terminal

License: GNU General Public License v3.0

Python 100.00%

python-sixel's Introduction

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

python-sixel's People

Contributors

saitoha avatar lubosz avatar urufusan avatar cocuh avatar ignisan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.