Skip to content

Instantly share code, notes, and snippets.

@PingjunChen
Forked from dellsystem/tile
Created January 27, 2022 20:51
Show Gist options
  • Select an option

  • Save PingjunChen/ee3ff4e47dd14cf85f65b8b5db1b2568 to your computer and use it in GitHub Desktop.

Select an option

Save PingjunChen/ee3ff4e47dd14cf85f65b8b5db1b2568 to your computer and use it in GitHub Desktop.
converting tifs to pyramidal tiffs
#!/usr/bin/env bash
# A bash script for converting all the files in a directory to pyramidal tiff
# Pass the directory the images are stored in as an argument
# But it will put the images in the current directory ... to be fixed
if [ $# -lt 3 ]; then
echo 'Usage: tile <directory> <extension> <desired_prefix>'
else
echo 'Looking for all files in directory: $1/'
FILES=$1/*.$2
i=1
for file in $FILES
do
echo "Processing $file file ..."
convert="vips im_vips2tiff $file $3_$i.tif:none,tile:256x256,pyramid"
echo $convert
echo `$convert`
i=$(( $i + 1 )) # ...bash
# break
done
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment