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
Powerful Features for Modern Development
Everything you need to generate professional thumbnails with ease and confidence
Highly Configurable
Extensive configuration options for quality, format, size, and positioning
Batch Processing
Process multiple files efficiently with parallel processing capabilities
High Performance
Built with Sharp library for lightning-fast image processing and optimization
Type Safety
Full TypeScript support with comprehensive type definitions and IntelliSense
Multiple Formats
Output thumbnails in JPEG, PNG, WebP, or AVIF formats with quality control
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
Images
High-quality image processing with metadata extraction
Videos
Frame extraction and video thumbnail generation
Documents
PDF rendering and document preview generation
Office
Microsoft Office and OpenDocument format support
Archives
Archive file recognition with custom thumbnails
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
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-generatorDependencies
npm install sharp canvas pdfjs-distCore image and PDF processing
npm install ffmpeg-staticVideo thumbnail extraction
npm install libreoffice-convertOffice 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