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

@lxgicstudios/imgbatch

v1.0.0

Published

Batch image processing. Resize, convert, optimize, watermark, and rename images. CLI tool for bulk operations.

Readme

imgbatch

Batch image processing. Resize, convert, optimize, watermark, and rename images. CLI tool for bulk operations.

Installation

npm install -g @lxgicstudios/imgbatch

Or use directly:

npx @lxgicstudios/imgbatch resize "images/*.jpg" 800x600

Commands

Resize images

imgbatch resize "photos/*.jpg" 1920x1080
imgbatch resize "uploads/*.png" 800x600 --fit contain

Fit options: cover (default), contain, fill, inside, outside

Convert format

imgbatch convert "images/*.png" webp
imgbatch convert "photos/*.jpg" avif -q 85

Formats: jpg, png, webp, avif, gif, tiff

Optimize file size

imgbatch optimize "uploads/*.jpg"
imgbatch optimize "gallery/**/*.png" -q 75

Generate thumbnails

imgbatch thumbnail "products/*.jpg" 200
imgbatch thumbnail "gallery/*.png" 150 -o thumbs/

Add watermark

imgbatch watermark "photos/*.jpg" logo.png
imgbatch watermark "*.jpg" watermark.png --position southeast

Positions: center, north, south, east, west, northeast, northwest, southeast, southwest

Other commands

imgbatch rotate "scans/*.jpg" 90
imgbatch grayscale "photos/*.jpg"
imgbatch blur "backgrounds/*.png" 10
imgbatch info photo.jpg

Options

| Option | Description | |--------|-------------| | -o, --output <dir> | Output directory (default: ./output) | | -q, --quality <n> | Quality 1-100 (default: 80) | | -p, --prefix <str> | Output filename prefix | | -s, --suffix <str> | Output filename suffix | | --fit <mode> | Resize fit mode | | --position <pos> | Watermark position | | --keep | Keep originals (don't overwrite) |

Programmatic Usage

const { resize, convert, optimize, thumbnail } = require('@lxgicstudios/imgbatch');

// Resize
await resize('photo.jpg', 'photo-small.jpg', { width: 800, height: 600 });

// Convert to WebP
await convert('photo.jpg', 'photo.webp', { quality: 85 });

// Optimize
await optimize('photo.jpg', 'photo.jpg', { quality: 80 });

// Thumbnail
await thumbnail('photo.jpg', 'photo-thumb.jpg', { size: 200 });

Examples

Prepare images for web

# Convert all PNGs to WebP
imgbatch convert "images/*.png" webp -q 85 -o web/

# Create responsive sizes
imgbatch resize "images/*.jpg" 1920x1080 -o large/
imgbatch resize "images/*.jpg" 800x600 -o medium/
imgbatch resize "images/*.jpg" 400x300 -o small/

Product photos workflow

# Optimize originals
imgbatch optimize "products/*.jpg"

# Generate thumbnails
imgbatch thumbnail "products/*.jpg" 200 -o thumbs/

# Add watermark for sharing
imgbatch watermark "products/*.jpg" logo.png -o protected/

Why imgbatch?

  • Fast - Powered by sharp (libvips)
  • Simple - Intuitive CLI commands
  • Flexible - Works with glob patterns
  • Modern formats - WebP, AVIF support

Built by LXGIC Studios

🔗 GitHub · Twitter