package giflib

  1. Overview
  2. Docs

Module Giflib.LzwSource

LZW Compression and Decompression

Provides functions for compressing and decompressing image data using the LZW algorithm, as used in GIF image encoding.

Sourceval decode : Bytes.t -> int -> Bytes.t

Decompresses LZW-encoded data given the initial code size.

Sourceval encode : Bytes.t -> int -> Bytes.t

Compresses data using LZW algorithm with the given initial code size.

Sourceval flatten_codes : ?pad:bool -> int -> (Z.t * int) list -> Bytes.t

Flattens a list of (code, bit length) pairs into a byte stream

Sourceval get_bits : Bytes.t -> int -> int -> int