imagext
v1.0.1
Published
A simple, fast, and powerful CLI tool powered by sharp to convert images to different formats.
Downloads
172
Maintainers
Readme
imagext
A simple, fast, and powerful CLI tool powered by sharp to convert images to different formats.
Description
imagext scans the current directory for supported image files and converts them to the specified output format. It handles various common image formats and ensures original files are preserved.
Features
- Powered by Sharp: High performance image conversion.
- Bulk Conversion: Converts all supported images in the current directory.
- Smart Skipping: Skips files that are already in the target format.
- Safe: Original files are never deleted.
- Supported Inputs:
.jpg,.jpeg,.png,.gif,.webp,.tiff,.avif.
Installation
You can run it directly using npx or install it globally via npm.
Run via npx
npx imagext <output_format>Global Installation
npm install -g imagextUsage
Navigate to the directory containing your images and run:
imagext <output_format>Arguments
<output_format>: The desired output image format (e.g.,webp,png,jpg).
Examples
Convert all images in the current directory to WebP:
imagext webpConvert all images to PNG:
imagext pngSupported Output Formats
imagext supports any output format supported by sharp. Common formats include:
webppngjpeg/jpgaviftiffgif
output
🔍 Searching for image files in: "/path/to/your/directory"
🎯 Converting to format: "WEBP"
--------------------------------------------------
⏳ Converting: image1.png -> image1.webp
✅ Success: image1.webp
ℹ️ Skipping: logo.webp (already in WEBP format)
⏳ Converting: photo.jpg -> photo.webp
✅ Success: photo.webp
--------------------------------------------------
✨ Done!
- 2 file(s) successfully converted.
- 1 file(s) skipped.
📌 Note: Original files have not been deleted.