Tiff
TIFF image decoder written entirely in JavaScript
Install / Use
/learn @image-js/TiffREADME
tiff
TIFF image decoder written entirely in JavaScript.
Installation
npm install tiff
Compatibility
TIFF standard
The library can currently decode greyscale and RGB images (8, 16 or 32 bits). It supports LZW compression and images with an additional alpha channel.
Extensions
Images compressed with Zlib/deflate algorithm are also supported.
API
Complete API documentation
tiff.decode(data[, options])
Decodes the file and returns TIFF IFDs.
IFD object
Each decoded image is stored in an IFD.
IFD#data
The data property is a Typed Array containing the pixel data. It is a
Uint8Array for 8bit images, a Uint16Array for 16bit images and a
Float32Array for 32bit images.
Other properties of IFD
size- number of pixelswidth- number of columnsheight- number of rowsbitsPerSample- bit depthalpha-trueif the image has an additional alpha channelxResolutionyResolutionresolutionUnit
tiff.pageCount(data)
Returns the number of IFDs (pages) in the file.
tiff.isMultiPage(data)
Returns true if the file has 2 or more IFDs (pages) and false if it has 1.
This is slightly more efficient than calling pageCount() if all you need to
know is whether the file has multiple pages or not.
License
Related Skills
healthcheck
337.3kHost security hardening and risk-tolerance configuration for OpenClaw deployments
imsg
337.3kiMessage/SMS CLI for listing chats, history, and sending messages via Messages.app.
node-connect
337.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
xurl
337.3kA CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.
