A script for fast batch compression and watermarking of images by AiratTop.
git clone https://github.com/AiratTop/imagemagick-watermark
cd imagemagick-watermark
./imagemagick-watermark.sh- The script works with the
imagesfolder; copy your source images into this folder. - Before running the script, install the ImageMagick package (command:
sudo apt install imagemagick). - Check the script's comments for detailed instructions (you can edit parameters as needed).
- A quick reference guide for image file operations is available here.
- Prepare your watermark in advance and place it in the root folder. The watermark file must be named
water.png, or you can specify it in theWATERvariable. - An example image,
example.jpg, is provided in theimagesfolder for demonstration purposes (this file can be deleted). - The
water.xcffile can be edited using GIMP and is used to create thewater.pngfile.
QUALITY=85- Changes the image quality (percentage).SIZE=1024- Resizes images while maintaining aspect ratio (width in pixels).WATER=water.png- Specifies the watermark file name (no spaces).SOURCE=images- Specifies the source images folder.
images- The folder for source images (this folder must not be deleted and is configured via theSOURCEvariable).result-small- The folder for compressed images (created automatically; can be deleted).result-water- The final folder containing compressed images with watermarks (created automatically; can be deleted).
This project is licensed under the MIT License - see the LICENSE file for details.
AiratTop
- Website: airat.top
- GitHub: @AiratTop
- Repository: imagemagick-watermark