Giter VIP home page Giter VIP logo

thehamdiz / webp_converter Goto Github PK

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

A concurrent multithreaded pure rust bulk & single image cli converter. to convert any image type to webp format with compression capabilities, configurations are dynamic; Defaults are based on my work experience as an eCommerce Manager.

Home Page: https://hamdiz.me

Rust 100.00%
compression compression-algorithm conversion ecommerce image image-compression image-conversion image-converter image-manipulation image-processing webp

webp_converter's Introduction

Rust WebP Image Converter

A high-performance, concurrent, multithreaded image converter written entirely in Rust. This tool allows for the bulk or single conversion of images to the compressed WebP format via a command-line interface (CLI). It's designed with static configurations derived from extensive experience in eCommerce image management, specifically tailored to the needs encountered during my tenure as an eCommerce Manager at Adam Medical Company.

WebConverterLogo.png

Author

Ahmad Hamdi Emara

Features

Concurrent & Multithreaded: Leverages Rust's powerful concurrency model for efficient image processing. Bulk & Single Image Conversion: Supports processing an entire folder of images or a single image file. Compressed WebP Format: Converts images to the WebP format, optimizing for high compression with minimal quality loss. Static Configurations: Utilizes pre-defined settings optimized through professional experience in eCommerce image optimization. CLI Interface: Easy-to-use command-line interface for straightforward operation. Installation (Include steps for installing Rust, if necessary, and building or installing your project.)

Ensure you have Rust installed on your system. You can download it from https://rustup.rs/.

Clone the repository to your local machine:

git clone https://github.com/theHamdiz/webp_converter.git

Navigate to the cloned repository directory:

cd webp_converter

Build the project using Cargo:

cargo build --release

The executable can be found in ./target/release/.

Usage

To use the Rust WebP Image Converter, you can utilize the following command-line arguments:

-p: Path to an image file or folder containing images to convert.
-l: A boolean toggle (true/false) to indicate whether file compression should be lossless or lossy.

Defaults to true.

-q: A number between 0 and 100 to indicate the quality of the compressed image.

Defaults to 75.

-c: A number between 0 and 6 to indicate the compression factor of the compressed image.

Defaults to 2.

-s: A boolean to indicate whether the image should be resized to (700x700)px or the nearest equivalent.

Defaults to false.

-n: Noise Ratio or PSNR Determines Noise to Signal Ratio.

Defaults to 40.

-V: Display the program version.
-h: Display the help menu with usage information.
-r: A boolean to indicate whether the program should recursively work on internal folders.

Note: this feature is not yet implemented

Examples

Convert a single image with 3X compression:

  ./webp_converter -p /path/to/image.png -c 3 -s true

On windows that would be:

  .\webp_converter.exe -p "path\to\image" -c 3 -s true

Convert all images in a folder without compression:

./webp_converter -p /path/to/folder -c 0 -q 100

Display the version of the program:

./webp_converter -V

Contributing

Feel free to contribute to this command line tool by submitting pull requests.

License

MIT License

webp_converter's People

Contributors

thehamdiz avatar

Stargazers

Endlin Boeingstein 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.