otf-pixels-codec-tiff
TIFF for Pixels, written from scratch
An Open Tech Foundation project
Baseline TIFF 6.0 in strips and tiles. A tiled TIFF decodes any region on its own, so a thumbnail of a huge scan reads only the tiles it needs.
[!TIP] Building an app or a server? Use
otf-pixelsinstead: it picks this codec from the file's bytes with itstifffeature.
Use it
Transcode row by row, without holding the image:
use ;
use ;
use TiffLayout;
let mut decoder = new?;
let descriptor = decoder.descriptor;
let mut encoder = new.with_layout?;
let mut out = Vecnew;
encoder.write_header?;
let mut row = vec!;
for _ in 0..descriptor.height
encoder.finish?;
Capabilities
| Area | Support |
|---|---|
| Decode | Both byte orders, strips and tiles, none/LZW/Deflate/PackBits, 1/8/16-bit |
| Encode | Strips or tiles, uncompressed or Deflate |
| Checked against | libtiff, both directions |
API
| Item | What it does |
|---|---|
TiffDecoder |
Decoder, with region access for tiled files |
TiffEncoder, TiffLayout |
Encoder and its strip/tile layout |
TiffImage, Directory, tag |
The format's own structures |
TiffCodec, probe |
Signature detection |
Part of Pixels
| Crate | Role |
|---|---|
otf-pixels |
The chainable Image API most users want |
otf-pixels-core |
Graph, tiles, scheduler, codec and op traits |
otf-pixels-ops |
Image operations |
otf-pixels-compress |
DEFLATE, zlib, LZW, checksums |
otf-pixels-codec-* |
One crate per format |
License
Apache-2.0 — see LICENSE.