Decompressing and Renaming Tiff images
I've been messing around with OCR for a possible new project. To train Tesseract, I had to decompress and rename a bunch of .tif files. Rather than deal with Photoshop, I decided to hack a little bash script using tiffcp. This also gave me a chance to play with the regex powers of Bash.
#!/bin/bash
for fname in *.g4.tif
do
if [[ $fname =~ (.*)\.g4\.tif ]]done
then
tiffcp -c none $fname ${BASH_REMATCH[1]}'.tif'else
echo "foo"fi
Categories
code , programming0 TrackBacks
Listed below are links to blogs that reference this entry: Decompressing and Renaming Tiff images.
TrackBack URL for this entry: http://hyperradiant.net/MT-4/mt-tb.cgi/232

Leave a comment