TIFF image decoder written entirely in JavaScript
$ npm install tiff
This package is written using ES2015 features. It is natively compatible with recent versions of Google Chrome and Node.js. You can transpile it with a tool like babel if you need to support more JavaScript engines.
Currently, only greyscale images (8 or 16 bits) can be decoded.
The package is in early development and API should be considered entirely unstable.
I am currently only focused on extending TIFF format support and will work on the API afterwards.
Returns a new decoder instance.
Decodes the file and returns a TIFF instance.
The TIFF object has an ifd
(Image File Directory) property which is an array containing all subimages.
Each decoded image is stored in an IFD
.
The data
property is a Typed Array containing the pixel data. It is a Uint8Array
for 8bit images
and a Uint16Array
for 16bit images.
size
- number of pixelswidth
- number of columnsheight
- number of rowsbitsPerSample
- bit depthxResolution
yResolution
resolutionUnit