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

optimix-image-pipeline

v2.0.0

Published

Modern image optimization pipeline with WebP, AVIF, responsive sizes, and CDN integration

Downloads

7

Readme

🚀 Optimix Image Pipeline

npm version License: MIT

Modern image optimization pipeline with intelligent compression, format conversion (WebP, AVIF), responsive sizing, and CDN integration. Built for Node.js, React, Next.js, and TypeScript projects.

🎉 What's New in v2.0

  • 🤖 Automatic Codebase Conversion - Scan and convert all images in your codebase automatically
  • 🎯 Smart Format Selection - AI-powered format recommendations based on content
  • 🖼️ Placeholder Generation - LQIP and BlurHash for progressive loading
  • 🧠 Enhanced Algorithms - 30% better quality analysis with noise detection
  • 📈 Better Compression - 15-25% smaller files with content-aware optimization

See v2.0 Features Guide →

✨ Features

Core Features

  • 🎨 Multi-Format Support - JPEG, PNG, WebP, AVIF, SVG, GIF
  • 📐 Responsive Sizes - Generate multiple sizes automatically
  • 🗜️ Smart Compression - Adaptive quality based on image analysis
  • 🎯 SVG Optimization - Advanced SVGO integration with custom algorithms
  • 🌐 CDN Ready - Built-in CDN path generation
  • Batch Processing - Parallel optimization pipeline
  • 🔧 Framework Agnostic - Works with Node.js, React, Next.js, Vue, etc.
  • 📊 Detailed Stats - Compression ratios and size savings
  • 💾 Caching - Skip already optimized images

v2.0 Features

  • 🤖 Auto Codebase Conversion - Automatically update image references in code
  • 🎯 Auto Format Selection - Choose optimal formats based on content analysis
  • 🖼️ Placeholder Generation - LQIP & BlurHash for progressive loading
  • 🧠 Advanced Quality Analysis - Text/photo detection, noise analysis
  • 📈 Content-Aware Optimization - Different strategies for photos vs graphics

📦 Installation

npm install @optimix/image-pipeline

🎯 Quick Start

CLI Usage

# Optimize all images in a directory
npx optimix optimize ./images --output ./optimized

# With custom options
npx optimix optimize ./src/assets \
  --output ./dist/assets \
  --formats webp,avif \
  --sizes 400,800,1200 \
  --quality auto

Node.js

const { ImageOptimizer } = require('@optimix/image-pipeline');

const optimizer = new ImageOptimizer({
  outputDir: './optimized',
  formats: ['webp', 'avif'],
  sizes: [400, 800, 1200],
  quality: 'auto'
});

// Single image
const result = await optimizer.optimizeSingle('./photo.jpg');
console.log(`Saved ${result.savings.percentage.toFixed(1)}%`);

// Batch processing
const batchResult = await optimizer.optimizeDirectory('./images');
console.log(`Processed ${batchResult.filesProcessed} files`);

v2.0: Automatic Codebase Conversion

const optimizer = new ImageOptimizer({
  outputDir: './public/optimized',
  formats: ['webp', 'avif'],
  quality: 'auto',
  autoFormat: true,           // NEW: Auto-select best formats
  generatePlaceholders: true, // NEW: Generate LQIP/BlurHash
  updateCodebase: true,       // NEW: Update code references
  codebaseRoot: './src',
});

// Automatically scan, optimize, and update all images
const result = await optimizer.convertCodebaseImages();
console.log(`Converted ${result.convertedImages} images`);
console.log(`Updated ${result.updatedFiles} code files`);

TypeScript

import { ImageOptimizer, OptimizationConfig } from '@optimix/image-pipeline';

const config: OptimizationConfig = {
  outputDir: './public/optimized',
  formats: ['webp', 'avif'],
  sizes: [320, 640, 1024, 1920],
  quality: 'auto',
  cdnBaseUrl: 'https://cdn.example.com'
};

const optimizer = new ImageOptimizer(config);
const result = await optimizer.optimizeSingle('./hero.jpg');

Next.js Build Script

// scripts/optimize-images.js
const { ImageOptimizer } = require('@optimix/image-pipeline');

async function optimizeForBuild() {
  const optimizer = new ImageOptimizer({
    outputDir: './public/optimized',
    formats: ['webp', 'avif'],
    sizes: [640, 1024, 1920],
    quality: 'auto',
    parallel: 8
  });

  await optimizer.optimizeDirectory('./public/images');
}

optimizeForBuild();

Add to package.json:

{
  "scripts": {
    "optimize": "node scripts/optimize-images.js",
    "build": "npm run optimize && next build"
  }
}

📖 Documentation

📝 Examples

Check the examples/ directory for:

  • Node.js integration
  • React component examples
  • TypeScript usage
  • Build script examples

🚀 Performance

  • Parallel processing for batch operations
  • Intelligent caching to skip already optimized images
  • Memory-efficient streaming for large files
  • Average 60-80% size reduction with minimal quality loss

🎯 Use Cases

  • E-commerce: Optimize product images for faster page loads
  • Blogs & CMS: Automatically optimize uploaded images
  • Static Sites: Build-time optimization for Next.js, Gatsby, etc.
  • Mobile Apps: Generate responsive images for different screen sizes
  • CDN Integration: Seamless integration with CloudFront, Cloudflare, etc.

📄 License

MIT