Created
January 25, 2024 18:47
-
-
Save badvision/d0b1d4d3f18903479603cba73eafe675 to your computer and use it in GitHub Desktop.
Create random images
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for (( i=1; i<=500; i++ )) | |
do | |
# Generate a random filename | |
filename="random_image_${i}.png" | |
# Use ImageMagick to create a random 100x100 pixel image | |
color1=$(shuf -e $(convert -list color | grep srgb | cut -d' ' -f1) | head -1 | tr [:upper:] [:lower:]) | |
color2=$(shuf -e $(convert -list color | grep srgb | cut -d' ' -f1) | head -1 | tr [:upper:] [:lower:]) | |
convert -size 100x100 gradient:${color1}-${color2} "${filename}" | |
echo "Generated ${filename} using ${color1}-${color2}" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment