DEV Community

Bobo
Bobo

Posted on

Batch Image Optimization at Warp Speed

100 Images, One Command

Uploading 50 product photos? Resizing a folder of screenshots? Converting a batch of PNGs to WebP?

Don't open Photoshop. Don't write a script. Do it in one line:

npx batch-image-tool compress ./images/ --quality 80
npx batch-image-tool resize ./photos/ --width 1200
npx batch-image-tool convert ./assets/ --to webp
npx batch-image-tool watermark ./output/ --text "© 2026"
Enter fullscreen mode Exit fullscreen mode

What It Does

  • Compress: Reduce file size by 60-80% without visible quality loss
  • Resize: Scale to exact dimensions, max dimension, or percentage
  • Convert: PNG ↔ JPG ↔ WebP ↔ AVIF
  • Watermark: Add text or image watermark
  • Rename: Batch rename with custom patterns
  • Format support: JPG, PNG, WebP, AVIF, GIF, TIFF

npm install -g batch-image-tool
Enter fullscreen mode Exit fullscreen mode

More Resources

  • 🛠️ My tools & open-source projects: GitHub
  • 📝 Blog & updates: TucaoWall
  • ☁️ Deploy your own cloud server and get $25 credit: DigitalOcean
  • 🐙 CLI Toolkit Pro (bundle of all my CLI tools): npm
  • 💼 Hire me on Freelancer: a0982

Top comments (0)