#!/bin/bash12# Wirtten by ChatGPT34# Define the base directory to start the search5BASE_DIR="$1"67# Check if the base directory is provided and exists8if [ -z "$BASE_DIR" ]; then9echo "Usage: $0 /path/to/directory"10exit 111fi1213if [ ! -d "$BASE_DIR" ]; then14echo "Directory $BASE_DIR does not exist."15exit 116fi1718# Function to process images19process_image() {20local image_path="$1"2122# Define output path (can be modified to save to a different location)23local output_path="$1" # ${image_path%.*}_tinted.${image_path##*.}"2425# Apply the tint and darkening26convert "$image_path" \27-modulate 80,50,55 \28"$output_path"2930echo "Processed $image_path -> $output_path"31}3233export -f process_image3435# Find and process image files36find "$BASE_DIR" -type f \( -iname '*.png' \) -exec bash -c 'process_image "$0"' {} \;3738echo "Image processing completed."394041