https://github.com/sunjay-dev/image-format-converter
A CLI tool to convert images formats with features like quality control, batch mode, and more.
https://github.com/sunjay-dev/image-format-converter
Last synced: 7 months ago
JSON representation
A CLI tool to convert images formats with features like quality control, batch mode, and more.
- Host: GitHub
- URL: https://github.com/sunjay-dev/image-format-converter
- Owner: sunjay-dev
- Created: 2025-06-24T18:39:35.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-06-25T05:04:44.000Z (8 months ago)
- Last Synced: 2025-06-25T05:33:24.010Z (8 months ago)
- Language: JavaScript
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# ๐ผ๏ธ Imgify - Image Format Converter

A simple and powerful CLI tool to **convert images** to different formats like WebP, JPEG, PNG, AVIF, and more โ powered by [Sharp](https://github.com/lovell/sharp).
---
## ๐ Features
- โ
Convert a single image or **batch convert all** in a folder
- ๐ฏ Format support: `webp`, `jpeg`, `png`, `avif`, `tiff`, `gif`
- ๐๏ธ Control output quality (`-quality=80`)
- ๐ Filter files by extension (`-ext=jpg`)
- ๐๏ธ Delete original files after conversion (`-del`)
* ๐งช **preview run** support โ see what will be converted (`-preview`)
---
### ๐ฆ Installation & Usage
### ๐ One-liner (No install needed):
```bash
npx imgify-cli input.png output.jpeg
```
You can use all options like:
```bash
npx imgify-cli -all -ext=png -f=webp -quality=80
```
This is the **recommended way** to use `imgify-cli` quickly and without setup.
---
### ๐ป Local Development or Manual Global Setup (For Offline Use or Contribution)
#### ๐ง Manual setup (if you want to contribute or link locally):
1. Clone the repo: (Open Terminal as **Administrator**)
```bash
git clone https://github.com/sunjay-dev/Image-Format-Converter
```
2. Enter the directory:
```bash
cd Image-Format-Converter
```
3. Install dependencies:
```bash
npm install
```
4. Link globally:
```bash
npm link
```
> Now you can run `imgify` anywhere.
---
## ๐งโ๐ป Usage
### โค Convert a single image
```bash
imgify input.jpg output.png
```
### โค Convert with a custom output
```bash
imgify input.jpg output.webp
```
### โค Convert all images in the current folder
```bash
imgify -all
```
### โค Convert only `.png` images
```bash
imgify -all -ext=png
```
### โค Convert and delete original files
```bash
imgify -all -del
```
### โค Preview conversion (preview run)
```bash
imgify -all --preview
```
---
## ๐ง Options
| Flag | Description | Default |
| -------------- | ------------------------------------------------------------ | ------- |
| `-all` | Convert all `.jpg`, `.jpeg`, `.png` in current folder | โ |
| `-quality=80` | Output quality (0โ100, lossy formats only) | `80` |
| `-format=webp` | Output format: `webp`, `jpeg`, `png`, `avif`, `tiff` | `webp` |
| `-ext=png` | Only convert files with the specified extension | all |
| `-del` | Delete the original file(s) after conversion | off |
| `-preview` | Simulate conversion (log what would be converted) | off |
| `-help` | Show usage instructions | โ |
---
## ๐งช Examples
```bash
imgify input.jpg -format=avif -quality=70
imgify -all -ext=jpeg -format=png -del
imgify input.png output.avif -quality=90
imgify -all -preview
```
---
## ๐ Supported Formats
* **Input**: `.jpg`, `.jpeg`, `.png`, `.webp`, `.tiff`, `.gif`, `.avif`
* **Output**: `webp`, `jpeg`, `png`, `avif`, `tiff`
> Internally uses [Sharp](https://www.npmjs.com/package/sharp) for fast, high-quality conversions.