#!/bin/bash

# Check if the user provided an image file
if [ $# -eq 0 ]; then
    echo "Usage: $0 <image_file>"
    exit 1
fi

INPUT_IMAGE="$1"

# Generate PNG file
WALLPAPER="$HOME/.cache/images/wallpaper.png"
magick "$INPUT_IMAGE" "$WALLPAPER"
# Generate a blurred wallpaper with blur settings (50x30)
BLURRED_WALLPAPER="$HOME/.cache/images/blurred_wallpaper.png"
magick "$INPUT_IMAGE" -blur 50x30 "$BLURRED_WALLPAPER"

# Generate a square image (resize while maintaining aspect ratio)
SQUARE_WALLPAPER="$HOME/.cache/images/square_wallpaper.png"
magick "$INPUT_IMAGE" -gravity center -extent 1:1 "$SQUARE_WALLPAPER"

echo "Generated $BLURRED_WALLPAPER and $SQUARE_WALLPAPER"
