/lzw-tiff-decoder

A WASM-based decoder for TIFF LZW compression.

Primary LanguageRustMIT LicenseMIT

lzw-tiff-decoder

npm version

A WASM-based LZW decoder for tiff images. Uses weezl, a purely safe and dependency-less Rust crate providing LZW decoding.

Installation

$ npm install lzw-tiff-decoder

Usage

import { decompress } from 'lzw-tiff-decoder';

const compressedBytes = new Uint8Array(/* tile or strip from tiff */);
const maxUncompressedSize = tileWidth * tileHeight * bitsPerSample / 8;

const decoded = await decompress(compressedBytes, maxUncompressedSize);

Development

$ cd js && npm install
$ npm run build