High Performance • Type Safe • Production Ready

Universal
Thumbnail Generator

Generate thumbnails from any file format with a comprehensive TypeScript library. Images, PDFs, videos, office documents, and archives—all supported.

Images

10+ formats

Videos

9+ formats

Documents

8+ formats

Archives

6+ formats

Lightning Fast

Built with Sharp for optimal performance and memory efficiency

Type Safe

Full TypeScript support with comprehensive type definitions

Developer Friendly

Simple API with extensive configuration options

30+
File Formats
Supported formats
4
Output Types
JPEG, PNG, WebP, AVIF
Performance
Sharp-powered
100%
Type Safety
TypeScript coverage

Powerful Features for Modern Development

Everything you need to generate professional thumbnails with ease and confidence

Flexible

Highly Configurable

Extensive configuration options for quality, format, size, and positioning

Efficient

Batch Processing

Process multiple files efficiently with parallel processing capabilities

Fast

High Performance

Built with Sharp library for lightning-fast image processing and optimization

Reliable

Type Safety

Full TypeScript support with comprehensive type definitions and IntelliSense

Versatile

Multiple Formats

Output thumbnails in JPEG, PNG, WebP, or AVIF formats with quality control

Smart

Smart Defaults

Intelligent fallbacks and placeholders for unsupported or corrupted files

Comprehensive File Format Support

Generate thumbnails from virtually any file type with intelligent fallbacks and format detection

10+ formats

Images

High-quality image processing with metadata extraction

JPEG
PNG
GIF
WebP
TIFF
BMP
SVG
AVIF
HEIC
HEIF
10+ formats

Videos

Frame extraction and video thumbnail generation

MP4
AVI
MOV
WMV
FLV
WebM
MKV
M4V
3GP
OGV
4+ formats

Documents

PDF rendering and document preview generation

PDF
TXT
MD
RTF
9+ formats

Office

Microsoft Office and OpenDocument format support

DOC
DOCX
XLS
XLSX
PPT
PPTX
ODT
ODS
ODP
6+ formats

Archives

Archive file recognition with custom thumbnails

ZIP
RAR
7Z
TAR
GZ
BZ2

Can't find your format? Open an issue on GitHub and we'll consider adding support!

Simple to Use, Powerful to Scale

Get started in minutes with our intuitive API, then scale to handle enterprise workloads

Code Examples

TypeScript
import { UniversalThumbnailGenerator } from "universal-thumbnail-generator";

const generator = new UniversalThumbnailGenerator({
  width: 300,
  height: 300,
  quality: 90,
  format: "jpeg",
});

// Generate thumbnail from file path
const result = await generator.generate("./image.jpg");

// Save the thumbnail
await fs.writeFile(result.fileName, result.fileBuffer);

Quick Installation

Get up and running in less than 2 minutes with your preferred package manager

Install Package

npm install universal-thumbnail-generator

Dependencies

Required
npm install sharp canvas pdfjs-dist

Core image and PDF processing

Optional
npm install ffmpeg-static

Video thumbnail extraction

Optional
npm install libreoffice-convert

Office document support

Quick Start

import { UniversalThumbnailGenerator } from "universal-thumbnail-generator";

const generator = new UniversalThumbnailGenerator();
const result = await generator.generate("./image.jpg");

Need help getting started? Check out our comprehensive documentation.

View Documentation