Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- for f in *.png; do
- background=$(ls -1 ../backgrounds/*.jpg | shuf -n 1)
- convert "$background" -resize "$(identify -format "%wx%h" "$f")^" -gravity center -extent $(identify -format "%wx%h" "$f") temp_background.jpg
- convert temp_background.jpg "$f" -composite "output_$f"
- rm temp_background.jpg
- done
- Transparent foreground and Background image arrangement:
- parent_directory/
- ├── foreground_images_folder/
- │ ├── image1.png
- │ ├── image2.png
- │ └── script.sh
- └── backgrounds/
- ├── background1.jpg
- ├── background2.jpg
- └── ...
Advertisement
Add Comment
Please, Sign In to add comment