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 hashes)
Built Distribution
Close
Hashes for libsixel-python-0.3.0.macosx-10.9-x86_64.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f71c25900b24a3ee3de3553d36be106c7c3ceeb60efee8010b800bec3c96a4b6 |
|
MD5 | c8a1754e0a6ce6db4550a721d56b5120 |
|
BLAKE2b-256 | d8d48bfc7691d2987ca2048bc0eeb46ed6199ccf02c33bf1de61bc14de35ffd1 |