Crate icy_sixel

Crate icy_sixel 

Source
Expand description

§icy_sixel

A 100% Rust SIXEL library for encoding and decoding SIXEL graphics.

§Features

  • Decoder: High-performance SIXEL decoder with SIMD optimization (SSE2)
  • Encoder: High-quality SIXEL encoder using quantette for color quantization

§Quick Start

§Encoding an image to SIXEL

use icy_sixel::SixelImage;

// RGBA image data (4 bytes per pixel)
let rgba = vec![255u8, 0, 0, 255, 0, 255, 0, 255]; // 2 red and green pixels
let image = SixelImage::from_rgba(rgba, 2, 1);
let sixel = image.encode()?;
print!("{}", sixel);

§Decoding SIXEL to image data

use icy_sixel::SixelImage;

let sixel_data = b"\x1bPq#0;2;100;0;0#0~-\x1b\\";
let image = SixelImage::decode(sixel_data)?;
// image.pixels contains RGBA pixel data (4 bytes per pixel)
println!("{}x{}", image.width, image.height);

Re-exports§

pub use decoder::DcsSettings;
pub use decoder::sixel_decode;Deprecated
pub use decoder::sixel_decode_from_dcs;Deprecated
pub use encoder::sixel_encode;
pub use encoder::sixel_encode_default;Deprecated
pub use encoder::EncodeOptions;
pub use sixel_image::BackgroundMode;
pub use sixel_image::PixelAspectRatio;
pub use sixel_image::SixelImage;

Modules§

decoder
encoder
Clean-room SIXEL encoder using quantette for high-quality color quantization.
sixel_image
The SixelImage type and related definitions.

Enums§

QuantizeMethod
The set of supported color quantization methods.
SixelError
Errors that can occur during SIXEL encoding or decoding.

Type Aliases§

Result
Result type for SIXEL operations.