Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tiff

Package Overview
Dependencies
Maintainers
4
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tiff

TIFF image decoder written entirely in JavaScript

  • 6.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
35K
decreased by-2.11%
Maintainers
4
Weekly downloads
 
Created
Source

tiff

TIFF image decoder written entirely in JavaScript.

Zakodium logo

Maintained by Zakodium

NPM version build status npm download

Installation

npm i 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

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 pixels
  • width - number of columns
  • height - number of rows
  • bitsPerSample - bit depth
  • alpha - true if the image has an additional alpha channel
  • xResolution
  • yResolution
  • resolutionUnit

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

MIT

FAQs

Package last updated on 08 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc