GithubHelp home page GithubHelp logo

rezrah / img-resizer-cli Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 505 KB

A command-line utility to quickly resize and optimize image files.

Home Page: https://npmjs.com/package/img-resizer-cli

License: Other

TypeScript 44.33% Shell 2.09% JavaScript 53.58%

img-resizer-cli's Introduction

Image resizer CLI

Example of img-resizer-cli being run in a command line with a progress indicating appearing beneath it, showing 44% completion rate

This command-line interface helps quickly resize and optimize image files.

Features

  • Resize images quickly and easily
  • Supports resizing of single images or entire folders
  • Optional flags for controlling image quality, file format, and more
  • Easy to use and understand command-line interface

You can specify a file or a folder, along with some optional flags such as quality. lowercase and remove-spaces.

Installation

You can install the Image Resizer CLI tool using npm. To install, simply run the following command:

npm install -g img-resizer-cli

Usage

To resize a single image, run the following command:

npx img-resizer-cli --file <path-to-file> --width <width> --output <path-to-output-folder>

If you want to resize a folder, use the --folder flag instead of --file.

Examples

Here are some examples of how you can use the Image Resizer CLI tool:

# Resizing and optimizing a single image
npx img-resizer-cli --file ~/Photos/example.jpg --width 1000 -q 90 -o ~/Photos/resized/

# Resize all images in a folder and its subdirectories to 500 pixels wide and output to a different folder
npx img-resizer-cli --folder ~/Photos/ --width 500 -o ~/Photos/resized/

# Resize images in a folder to 300 pixels wide, convert to GIF format, and remove spaces from the file names
npx img-resizer-cli --folder ~/Photos/ --width 300 --format gif --remove-spaces

Options

Option Description
--file or --folder Specifies the file name to be processed
-w Specifies the width of the output image in pixels
-o Specifies the output directory for the processed file. Overwrites the handled file by default if not passed.
-q Specifies the quality of the output image on a scale from 1 to 100
--format (Optional) Specifies the file format of the output image. Allowed values: jpg, jpeg, png, gif, webp
--lowercase (Optional) Converts the file name to lowercase
--remove-spaces (Optional) Removes spaces from the file name

Contributing

Contributions to this project are welcome! If you find a bug or have an idea for a new feature, please submit an issue or a pull request.

License

This project is licensed under the Mozilla Public License 2.0.

img-resizer-cli's People

Contributors

github-actions[bot] avatar rezrah avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.