Skip to content

Thinkteam20/Image-Script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ–ผ๏ธ Image-Script: Simple CLI Image Compression & Format Conversion Tool

๐Ÿ“Œ Overview

Image-Script is a straightforward Node.js command-line tool that enables batch image compression via TinyPNG API and format conversion for images in a folder. It automates repetitive image optimization tasks to streamline development workflows.

โš™๏ธ Key Features

  • ๐Ÿ“ Batch processing of images in ./target folder
  • ๐Ÿ—œ๏ธ High-quality compression through TinyPNG API
  • ๐Ÿ”„ Format conversion support (JPEG/PNG/WebP)
  • ๐Ÿงน Automatic skip of non-image files
  • ๐Ÿ“‚ Auto-creation of ./Compressed and ./Converted output folders

๐Ÿš€ How to Use

1. Installation

git clone https://github.com/Thinkteam20/Image-Script.git
cd Image-Script
npm install

2. Environment Setup

# Create .env file with your TinyPNG API key
echo "API_KEY=your_tinypng_api_key" > .env

3. Prepare Images

  • Place images to compress or convert in the ./target folder
  • Supported formats: .jpg, .jpeg, .png, .webp

4. Run the Tool

node index.js
  • Choose 1: Image compression (maintains original format)
  • Choose 2: Format conversion (select PNG, WebP, or JPEG)

๐Ÿ“‚ Output

  • Compressed files: ./Compressed/
  • Converted files: ./Converted/

๐Ÿ’ก Development Intent

Built to automate repetitive image optimization tasks encountered during web development projects. A simple yet practical CLI tool that has been used across 20+ real projects.

๐Ÿ›  Tech Stack

  • Node.js (fs, path, readline modules)
  • TinyPNG API (tinify package)
  • dotenv (API key management)

๐Ÿ”ฎ Future Improvements

  • Duplicate filename handling
  • Recursive subfolder processing
  • Progress indicator display
  • User configuration options (quality settings)

Made to save time, not to be fancy. A small tool that reduces repetitive work.

About

Image-Script Resizer and Formatter

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published