npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@thi.ng/pixel-io-tiff

v0.1.0

Published

Basic TIFF image format support for @thi.ng/pixel

Readme

@thi.ng/pixel-io-tiff

npm version npm downloads Mastodon Follow

[!NOTE] This is one of 212 standalone projects, maintained as part of the @thi.ng/umbrella monorepo and anti-framework.

🚀 Please help me to work full-time on these projects by sponsoring me on GitHub. Thank you! ❤️

About

Basic TIFF image format support for @thi.ng/pixel.

This lightweight package (~2.6KB brotli) current only supports read access and the following TIFF features:

  • Metadata: Multiple IFDs (tag directories), optional Exif, GPS, Sub-IFDs extraction
  • Compression: uncompressed or deflate
  • Color formats: Grayscale 8/16 bits, (A)RGB 8bit
  • Data layout: Tiled or strips, sub-images

The following functions are included:

  • readIFDs(): Only read image metadata directories (incl. Exif/GPS if available), without parsing any pixel data. Parsing of nested IFDs can be disabled.
  • readTIFF(): Read TIFF image and parse pixel data. If an IFD is given, only the related sub-image will be read (else the main image is used).
  • intBufferFromTIFF(): Converts a parsed raw TIFF to a @thi.ng/pixel buffer

Status

ALPHA - bleeding edge / work-in-progress

Search or submit any issues for this package

Installation

yarn add @thi.ng/pixel-io-tiff

ESM import:

import * as pit from "@thi.ng/pixel-io-tiff";

Browser ESM import:

<script type="module" src="https://esm.run/@thi.ng/pixel-io-tiff"></script>

JSDelivr documentation

For Node.js REPL:

const pit = await import("@thi.ng/pixel-io-tiff");

Package sizes (brotli'd, pre-treeshake): ESM: 2.56 KB

Dependencies

Note: @thi.ng/api is in most cases a type-only import (not used at runtime)

API

Generated API docs

Basic usage

import {
    intBufferFromTIFF,
    readIFDs,
    readTIFF,
    Tag,
    Exif,
    type IFD,
} from "@thi.ng/pixel-io-tiff";
import { readBinary } from "@thi.ng/file-io";

// load as Uint8Array
const buf = readBinary("example.tiff");

// read metadata directories of all sub-images in the loaded TIFF (byte array)
// (this op does only deals with metadata and does NOT parse any pixel data)
// (options shown here are defaults)
const ifd = readIFDs(buf, { float: true, subIFD: true, all: true });

// the first IFD in a TIFF always refers to the main image
console.log(ifd);
// [
//   {
//       "256": [ 1920 ],
//       "257": [ 1473 ],
//       "258": [ 16, 16, 16 ],
//       "259": [ 8 ],
//       "262": [ 2 ],
//       "271": "Apple",
//       "272": "iPhone 11",
//       ...
//   },
//   { ... }
// ]

// access specific metadata tags
// (tag values are always arrays, strings or arrays of sub-IFDs)
console.log("size", ifd[0][Tag.ImageWidth][0], ifd[0][Tag.ImageLength][0]);
// size 1920 1473

// access Exif metadata
const exif = <IFD>ifd[0][Tag.Exif][0];
console.log(
    "exif",
    exif[Exif.FNumber][0],
    exif[Exif.ExposureTime][0],
    exif[Exif.DateTimeOriginal]
);
// exif 1.8 0.0002 2024:10:22 14:16:01

// actually parse TIFF fully and convert to thi.ng/pixel buffer
// (the given IFD is optional and can be used to just parse a sub-image (e.g. thumbnail))
const img = intBufferFromTIFF(await readTIFF(buf, ifd[0]));
// IntBuffer { size: [ 1920, 1473 ], stride: [ 1, 1920 ], format: { __packed: true, type: 'u32', ... } }

Authors

If this project contributes to an academic publication, please cite it as:

@misc{thing-pixel-io-tiff,
  title = "@thi.ng/pixel-io-tiff",
  author = "Karsten Schmidt",
  note = "https://thi.ng/pixel-io-tiff",
  year = 2025
}

License

© 2025 Karsten Schmidt // Apache License 2.0