Tapnesh-CLI
Tapnesh is a CLI tool that will optimize all your images in parallel easily and efficiently!
:sparkles: Tapnesh :sparkles:
Tapnesh is a CLI bash script which will optimize all your images in parallel easily and efficiently!
You can use it on a single image or specify a whole directory.
Demo
Image Size: 1920x1080
:star: Before => Original size: 863kb

:star: After => Optimized Size: 304kb (64.85% size decreased using -q 70 in 0.06 seconds)

Examples
Optimize single imagetapnesh img.png
Optimize single image with 75% of qualitytapnesh img.jpg -q 75
Optimize images in mydir directorytapnesh mydir
Optimize images in mydir directory recursive
tapnesh mydir -R
Optimize single image and keep old filetapnesh img.jpg -k
Optimize whole directory and keep old files with 85% of qualitytapnesh mydir -R -q 85 -k
Usage
Usage: tapnesh [-q|--quality <arg>] [-R|--(no-)recursive] [-v|--(no-)verbose] [-k|--(no-)keep] [-h|--help] <path>
<path>: Path to directory for optimization
-q, --quality: Sets quality for optimized images, can be a value from 1 to 100. (100 means lossless optimization) (default: '80')
-R, --recursive, --no-recursive: Do recursive (off by default)
-v, --verbose, --no-verbose: Be verbose (off by default)
-k, --keep, --no-keep: Keep old files (off by default)
-h, --help: Prints help
Pre-Install
You'll first need to install the dependencies
Ubuntu and other Debian based distros:sudo apt install pngquant parallel jpegoptim
Arch:sudo pacman -S pngquant parallel jpegoptim
Other distros:
Just install pngquant parallel jpegoptim using your package manager.
Currently, only gnu\linux based distros are supported.
Installation
If you trust me, just run this in your terminalcurl -Ss https://raw.githubusercontent.com/JafarAkhondali/Tapnesh/master/install.sh | bash
else: just copy the tapnesh.sh to some executable path
Community
:robot: TapneshBot:
A dockerized telegram bot which can optimize your images using telegram messenger.
@tapneshbot
Dependencies
pngquant
parallel
jpegoptim
How does it work?
Tapnesh is only a wrapper to optimize images using jpegoptim for jpe?g and pngquant for png files.
If optimizing multiple images (for example, working on a directory), Tapnesh uses parallel package under the hood to work optimize images per one cpu core.
Contributing
Are you a user?
Please suggest your requirements, ideas and bugs in issues.
Are you a developer?
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature - Commit your changes:
git commit -am 'Add some feature' - Push to the branch:
git push origin my-new-feature - Submit a pull request
License
GNU General Public License v3