Bash script to resize, strip metadata and optimize images.
- Shell 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| LICENSE | ||
| README.md | ||
| web_optimize_img.desktop | ||
| web_optimize_img.sh | ||
web_optimize_img
Bash script to resize, strip metadata from, and optimize images. It can be used to prepare images for Web publishing. Supports JPEG, PNG and SVG.
Intro
This script uses file list as an input and can be invoked from command line or from file manager. You can configure preferred output image size in web_optimize_img.sh:
SIZE="1920x1920\>" # '\>' stands for downscale only.
See ImageMagick help for more details.
You can also customize output file name prefix:
PREFIX="opt_"
Requirements
- ImageMagick for resizing and stripping metadata;
- jpegoptim for JPEG;
- zopflipng for PNG;
- svgo for SVG.
In Arch Linux those can be installed with
sudo pacman -S imagemagick jpegoptim zopflipng svgo
Command line use
web_optimize_img.sh photo.jpg scheme.png logo.svg
Dolphin intergration
Edit web_optimize_img.desktop and adjust Exec key to use your path to web_optimize_img.sh.
Copy web_optimize_img.desktop to ~/.local/share/kio/servicemenus/. The context menu item will then be shown for supported image formats.