Skip to main content

libsixel binding for Python

Project description

What is this?

This module is a python wrapper of libsixel.

libsixel: https://github.com/saitoha/libsixel

Install

Example 1. Install into the python prefixed with ‘/usr/local’

$ git clone https://github.com/saitoha/libsixel.git
$ cd libsixel
$ ./configure --enable-python --prefix=/usr/local
$ make install

Example 2. Install into only current active python

$ git clone https://github.com/saitoha/libsixel.git
$ cd libsixel
$ ./configure --disable-python
$ make install  # install libsixel
$ cd python
$ python setup.py install  # install python module

Code Example

encoder

from libsixel.encoder import Encoder, SIXEL_OPTFLAG_WIDTH, SIXEL_OPTFLAG_COLORS

encoder = Encoder()
encoder.setopt(SIXEL_OPTFLAG_WIDTH, "300")
encoder.setopt(SIXEL_OPTFLAG_COLORS, "16")
encoder.encode("test.png")

decoder

from libsixel.decoder import Decoder, SIXEL_OPTFLAG_INPUT, SIXEL_OPTFLAG_OUTPUT

decoder = Decoder()
decoder.setopt(SIXEL_OPTFLAG_INPUT, "test.six")
decoder.setopt(SIXEL_OPTFLAG_OUTPUT, "test.png")
decoder.decode()

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

libsixel-python-0.3.0.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

libsixel-python-0.3.0.macosx-10.9-x86_64.tar.gz (12.1 kB view details)

Uploaded Source

File details

Details for the file libsixel-python-0.3.0.tar.gz.

File metadata

File hashes

Hashes for libsixel-python-0.3.0.tar.gz
Algorithm Hash digest
SHA256 f42c0411550adda437af9f1ddddc9fc38eb2992a7ecf4ca2834fb3c9e7b88b0c
MD5 dc6b69ad3b13792cccd040827a334259
BLAKE2b-256 e03902258b6e7edd74eb8b2b1b2f9d03d9f0ab7ff9f15bcdcbfaa267692159ed

See more details on using hashes here.

File details

Details for the file libsixel-python-0.3.0.macosx-10.9-x86_64.tar.gz.

File metadata

File hashes

Hashes for libsixel-python-0.3.0.macosx-10.9-x86_64.tar.gz
Algorithm Hash digest
SHA256 f71c25900b24a3ee3de3553d36be106c7c3ceeb60efee8010b800bec3c96a4b6
MD5 c8a1754e0a6ce6db4550a721d56b5120
BLAKE2b-256 d8d48bfc7691d2987ca2048bc0eeb46ed6199ccf02c33bf1de61bc14de35ffd1

See more details on using hashes here.

Supported by

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