a-sixel
A-Sixel library for encoding sixel images.
Basic Usage
use KMeansSixelEncoder;
use RgbImage;
let img = new;
println!;
Choosing an Encoder
- I want fast encoding with good quality:
- Use
KMeansSixelEncoderorADUSixelEncoder.
- Use
- I'm time constrained:
- Use
ADUSixelEncoder,BitSixelEncoder, orOctreeSixelEncoder. You can customizeADUby lowering theSTEPSparameter to run faster if necessary while still getting good results.
- Use
- I'm really time constrained and can sacrifice a little quality:
- Use
BitSixelEncoder<NoDither>.
- Use
- I want high quality encoding, and don't mind a bit more computation:
- Use
FocalSixelEncoder. - This matters a lot less if you're not crunching the palette down below 256 colors.
- Note that this an experimental encoder. It will likely produce better comparable or better results than other encoders, but may not always do so. On the test images, for my personal preferences, I think it's slightly better - particularly at small palette sizes. It works by computing weights for each pixel based on saliancy maps and measures of local statistics. These weighted pixels are then fed into a weighted k-means algorithm to produce a palette.
- Use
License: MIT OR Apache-2.0