LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Converting color TIFF files to black and white with ImageMagick--HOW?? (http://www.linuxquestions.org/questions/linux-software-2/converting-color-tiff-files-to-black-and-white-with-imagemagick-how-741430/)

Tom Nichol 07-20-2009 10:53 AM

Converting color TIFF files to black and white with ImageMagick--HOW??
 
Last week, I scanned some 36 pages of sheet music into my laptop, hoping to import them into Finale PrintMusic, which I also have running on my laptop under WINE. HOWEVER--I inadvertently misread the instructions in PrintMusic, and instead of saving the TIFF files as black and white, lineart, 300 DPI, one dot per pixel, I saved the TIFF files as COLOR!! Needless to say, PrintMusic refuses to touch the files. Can ImageMagick convert these files to black and white,and, if so, how do I go about doing it? I'm not used to doing things in Linux from the command line, so I can use all the help I can get!! Thanks in advance!

colucix 07-20-2009 11:35 AM

Code:

convert input.tif -colorspace Gray output.tif
If you want to loop over the .tif files:
Code:

mkdir ./ouput
for file in *.tif
do
  convert $file -colorspace Gray ouput/$file
done


Tom Nichol 07-20-2009 03:31 PM

"colorspace" or "monochrome"?
 
Thanks for the reply--BUT--are you sure that option shouldn't be "-monochrome" instead of "-colorspace"? Also, do I need to cd to the directory the tif files are in first, or to the ImageMagick directory (wherever that may be!), or what? Thanks again, regardless!

colucix 07-20-2009 03:35 PM

Well, you can try -monochrome at your pleasure. I tried it on my system but it does not work, resulting in a blank image. And yes, you have to change to the directory where the tif files are stored. for file in *.tif matches all .tif in the current directory. The resultin b/w images will be saved in directory ./ouput with the same name as the original.


All times are GMT -5. The time now is 01:54 AM.