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

tilr

v1.0.0

Published

Generate tile-based animations from video files using differential binary encoding

Readme


Table of Contents


About

| original | tile animation | | -------------------------- | ------------------------------------- | | original | tile animation |

Tile Animation Generator transforms ordinary videos into charming, pixel-art style tile animations. Extract silhouettes from any video and watch them come alive as playful, retro-inspired mosaic animations in your web browser.

Perfect for creating unique visual effects, artistic presentations, or adding a nostalgic pixel aesthetic to your projects.

Bonus: The efficient CADF binary format achieves 94.8% size reduction, making animations lightweight and fast to load.


Technologies

| Technology | Version | Description | | ---------- | ------- | ---------------------- | | Node.js | >= 18 | Runtime environment | | ffmpeg | Latest | Video frame extraction | | Jimp | ^1.6.0 | Image processing | | Commander | ^13.1.0 | CLI framework |


Prerequisites

  • Node.js 18 or higher
  • ffmpeg installed on your system

Supported Video Formats

This tool supports all video formats that ffmpeg can decode:

| Format | Extension | | ------ | --------------- | | MP4 | .mp4 | | WebM | .webm | | AVI | .avi | | MOV | .mov | | MKV | .mkv | | FLV | .flv | | WMV | .wmv | | MPEG | .mpeg, .mpg |

Note: Any format supported by your installed ffmpeg version will work.

Installing ffmpeg

# Ubuntu/Debian
sudo apt-get install ffmpeg

# macOS
brew install ffmpeg

# Windows
# Download from https://ffmpeg.org/download.html

Installation

npm install tilr

Or clone the repository:

git clone https://github.com/sahksas/tilr.git
cd tilr
npm install

Usage

CLI

Basic usage:

npx tilr video.mp4 -o ./output

With options:

npx tilr video.mp4 -o ./output \
  --fps 15 \
  --tile-size 8 \
  --chunk-size 60 \
  --verbose

Show help:

npx tilr --help

CLI Options

| Option | Default | Description | | --------------------------- | ---------------- | ---------------------------- | | -o, --output <dir> | ./<video-name> | Output directory | | --fps <number> | 15 | Frame rate | | --tile-size <number> | 8 | Tile size in pixels | | --chunk-size <number> | 60 | Frames per chunk | | --brightness-min <number> | 10 | Minimum brightness threshold | | --brightness-max <number> | 120 | Maximum brightness threshold | | --green-ratio <number> | 1.5 | Green color ratio threshold | | -v, --verbose | false | Enable verbose logging |

Programmatic API

import { generateTileAnimation } from "tilr";

const result = await generateTileAnimation({
  inputVideo: "./video.mp4",
  outputDir: "./output",
  fps: 15,
  tileSize: 8,
  chunkSize: 60,
});

console.log(`Generated ${result.totalChunks} chunks`);
console.log(`Size reduction: ${result.stats.reduction}%`);

Decoder

The decoder works in both Node.js and browser environments:

import { decodeCADF } from "tilr/decoder";

// Node.js
import fs from "fs";
const buffer = fs.readFileSync("./output/frames-001.bin");
const frames = decodeCADF(buffer);

// Browser
const response = await fetch("./frames-001.bin");
const arrayBuffer = await response.arrayBuffer();
const frames = decodeCADF(arrayBuffer);

// Result: frames[0] = { frame: 0, coordinates: [[x, y], ...], totalPoints: 14250 }

Output Format

Directory Structure

output/
├── frames-001.bin   # CADF binary chunk 1
├── frames-002.bin   # CADF binary chunk 2
├── ...
└── config.json      # Metadata

Binary Format (CADF)

CADF (CAT Diff Format) uses differential encoding for maximum efficiency:

  • First frame: Complete coordinate data
  • Subsequent frames: Only differences from the previous frame

| Metric | Value | | ----------------------- | ----- | | JSON → CADF reduction | 94.8% | | With Brotli compression | 98.3% |


Pipeline

The generation process consists of 4 steps:

  1. Frame Extraction - Extract frames from video using ffmpeg
  2. Silhouette Extraction - Detect tile coordinates using Jimp
  3. Chunk Splitting - Split data into manageable chunks
  4. Binary Conversion - Encode to CADF with round-trip verification

Viewer

Preview generated animations using the built-in viewer:

# Using the CLI
npx tilr view ./output

# Or manually with http-server
npx http-server ./output -p 8080
# Open http://localhost:8080/viewer/ in your browser

Viewer Features:

  • Play/pause animation
  • Seek through frames
  • Adjust tile size, color, and background

Documentation


Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.