https://github.com/JafarAkhondali/Tapnesh
CLI bash script to optimize images in parallel easily and efficiently!
https://github.com/JafarAkhondali/Tapnesh
image image-optimization optimization seo seotools
Last synced: 3 months ago
JSON representation
CLI bash script to optimize images in parallel easily and efficiently!
- Host: GitHub
- URL: https://github.com/JafarAkhondali/Tapnesh
- Owner: JafarAkhondali
- License: gpl-3.0
- Created: 2017-11-27T00:55:34.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2020-07-21T15:22:30.000Z (over 5 years ago)
- Last Synced: 2024-05-03T12:48:02.501Z (almost 2 years ago)
- Topics: image, image-optimization, optimization, seo, seotools
- Language: Shell
- Homepage:
- Size: 34.2 KB
- Stars: 19
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-wpo - Tapnesh-CLI - Tapnesh is a CLI tool that will optimize all your images in parallel easily and efficiently! (Image Optimizers / Meetups)
- fucking-awesome-wpo - Tapnesh-CLI - Tapnesh is a CLI tool that will optimize all your images in parallel easily and efficiently! (Image Optimizers / Meetups)
README
:sparkles: Tapnesh :sparkles:
[](https://github.com/davidsonfellipe/awesome-wpo/) 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 image
`tapnesh img.png`
Optimize single image with 75% of quality
`tapnesh img.jpg -q 75`
Optimize images in `mydir` directory
`tapnesh mydir`
Optimize images in `mydir` directory recursive
`tapnesh mydir -R`
Optimize single image and keep old file
`tapnesh img.jpg -k `
Optimize whole directory and keep old files with 85% of quality
`tapnesh mydir -R -q 85 -k `
Usage
---
```
Usage: tapnesh [-q|--quality ] [-R|--(no-)recursive] [-v|--(no-)verbose] [-k|--(no-)keep] [-h|--help]
: 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 terminal
`curl -Ss https://raw.githubusercontent.com/JafarAkhondali/Tapnesh/master/install.sh | bash`
else: just copy the `tapnesh.sh` to some executable path
Community
===
:robot: [TapneshBot](https://github.com/AlirezaKm/TapneshBot):
A dockerized telegram bot which can optimize your images using telegram messenger.
[@tapneshbot](http://t.me/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?**
1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request
## License
GNU General Public License v3