Skip to content

Instantly share code, notes, and snippets.

@ilkayisik
Last active May 2, 2019 19:57
Show Gist options
  • Save ilkayisik/770cb752b6995d25b14d9e24cbbb08b7 to your computer and use it in GitHub Desktop.
Save ilkayisik/770cb752b6995d25b14d9e24cbbb08b7 to your computer and use it in GitHub Desktop.
various bash operations in one file including forloop, listing all files in a directory, manipulate names to create output name, change backgeound color with image magick
root=pat/to/root
cd ${root}
for tiffile in *.tif; do
echo $tiffile
in_file=${tiffile}
out_file=${in_file%.*}_whitebg.tif
convert -fill white -opaque black ${in_file} ${out_file}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment