Expand description
TIFF decoding and encoding with zenpixels integration.
Wraps the tiff crate, providing a pixel-buffer-oriented API that
integrates with the zen* codec ecosystem.
§Quick start
use zentiff::{decode, probe, encode, TiffDecodeConfig, TiffEncodeConfig};
use enough::Unstoppable;
// Decode
let data: &[u8] = &[]; // your TIFF bytes
let output = decode(data, &TiffDecodeConfig::default(), &Unstoppable)?;
println!("{}x{}", output.info.width, output.info.height);
// Encode
let encoded = encode(&output.pixels.as_slice(), &TiffEncodeConfig::default(), &Unstoppable)?;§Supported formats
§Decode
All color types and sample depths supported by the tiff crate:
- Gray, GrayAlpha, RGB, RGBA in u8/u16/u32/u64/i8/i16/i32/i64/f16/f32/f64
- Palette (expanded to RGB8)
- CMYK/CMYKA (converted to RGBA)
- YCbCr, Lab (decoded as RGB)
§Encode
- Gray, RGB, RGBA in u8/u16/f32
- GrayAlpha (expanded to RGBA for encoding)
- LZW, Deflate, PackBits, or uncompressed
- Horizontal prediction for improved compression
- Standard and BigTIFF formats
Modules§
- codec
- zencodec trait implementations for zentiff.
Structs§
- Tiff
Decode Config - Decode configuration for TIFF operations.
- Tiff
Decode Output - TIFF decode output.
- Tiff
Encode Config - Encode configuration for TIFF operations.
- Tiff
Info - TIFF image metadata from decoding.
Enums§
- Compression
- Compression method for TIFF encoding.
- Predictor
- Predictor for TIFF encoding.
- Tiff
Error - Errors from TIFF encode/decode operations.
Functions§
- decode
- Decode the first frame of a TIFF file to pixels.
- encode
- Encode a PixelBuffer to TIFF bytes.
- encode_
into - Encode a PixelSlice to TIFF, appending to the provided output buffer.
- probe
- Probe TIFF metadata without decoding pixels.
Type Aliases§
- Result
- Result type alias for zentiff operations.