TotallyNotChase / glitch-this

:camera: Glitchify images and GIF - with highly customizable options!
MIT License
1.75k stars 63 forks source link

Can Glitch_This work on folders like a batch operation? #40

Open LinuxBeaver opened 2 years ago

LinuxBeaver commented 2 years ago

I'd like to know if GT can apply operations to every image in a folder.

TotallyNotChase commented 2 years ago

you should be able to do it via your shell, something like this in bash perhaps-

for file in /dir/*
do
  glitch_this [options] "$file"
done
jeeftor commented 3 months ago
#!/bin/bash

# For each file in the input directory
for file in ./input/*; do
  # Get the filename
  filename=$(basename "$file")

  # Calculate file/without extension
  output_file=$(echo $filename | cut -f 1 -d '.').gif

  echo $output_file

  # Run the script on the file
  echo $file

    glitch_this $file  -sd 69 -c -f -i .2 -st 7 -g -o ./output/$output_file 1
done