I have several folders of 600 dpi TIFFs (CCITT Group IV, so black & white) that I need to convert to screen resolution PNGs - so in ImageMagick terms, I need to convert the format and resample the images to ~80 dpi. My first approach was to perform this in a single mogrify command (this is in bash on Mac OS X):
for folder in $(find * -maxdepth 0 -type d ); \
do mogrify -path "$folder/medium" -format png -resample 31.5% "$folder/tiff/*.tif"; \
done
But the result was awful. The text in the resulting image was completely illegible. So I changed this to a two step process, (1) converting the TIFF to PNG at original resolution, then (2) downsizing the resolution:
for folder in $(find * -maxdepth 0 -type d ); \
do mogrify -path "$folder/medium" -format png "$folder/tiff/*.tif"; \
mogrify -resample 31.5% "$folder/medium/*.png"; \
done
While this process resulted in nice and crisp results at 80 dpi, the process was much slower, since I'm now writing the full resolution file to disk before downsizing the resolution.
Does anyone have a suggestion for the best way to accomplish a conversion and downsizing of resolution in a single step?
sips
command built into OSX? – Digital Traumasips
before. Looks extremely convenient. I'll give it a shot. Thanks! These resources look helpful: developer.apple.com/library/mac/documentation/Darwin/Reference/… straylink.wordpress.com/2009/01/24/… and ainotenshi.org/818/resizing-images-using-the-command-line – Joe Wicentowski