summaryrefslogtreecommitdiff
path: root/util/generate_smaller.sh
blob: 68769b46754030fb81884aeeb157475954555420 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env bash

OUTPUT_DIR='better_noise_logos'

for width in $(seq 16 1 96);do 
  echo "Making width of $width"
  for brand in $1/*;do
    mkdir -p "$OUTPUT_DIR/$brand"

    find $brand -iname '*.png' | while read image;do
      BRI=$((80 + RANDOM % 40))
      SAT=$((80 + RANDOM % 40))
      HUE=$((60 + RANDOM % 80))
      width_off=$((RANDOM % (320-width)))
      height_off=$((RANDOM % (240-width)))
      convert -size 320x240 xc: +noise Random $image -modulate $BRI,$SAT,$HUE -geometry ${width}x+${width_off}+${height_off} -composite "$OUTPUT_DIR/$brand/`basename $image`.$width.png"
      sleep 1
    done
  done

done