Page 1 of 1

Grayscale to B&W images

Posted: Fri Aug 29, 2014 12:37 pm
by Marceloh.

I have some grayscale score images [for example, 2454 x 3473 pixels (297 dpi) scanned by BNF] and would like to convert them to 600dpi B&W images (using Irfanview's CCITT Fax 4 compression). Can someone help me?


Re: Grayscale to B&W images

Posted: Fri Aug 29, 2014 1:46 pm
by Marceloh.
My procedure:

1) Open the grayscale image in Irfanview. Go to menu Image>Resize/Resample...;
2) Set new size (Width and Height) - Units: pixels
3) Select these boxes: (Preserve aspect ratio (proporcional) and Apply sharpen after Resample
4) DPI: 600
5) Size method: Resample (better quality) / Resample filter (enlarging only): Lanczos (slowest)
6) Press OK.
7) Go to File>Save as... (CCITT Fax 4 TIFF compression checked)
Finally, open the created image in Gimp program just to make rotate corrections and cut the exceeding margins. Save again with CCITT Fax 4 TIFF compression.

Any sugestions to obtain better results?

Re: Grayscale to B&W images

Posted: Fri Aug 29, 2014 10:24 pm
by cypressdome
I use Imagemagick with a script in the following format that I run under Cygwin on my Windows 7 machine:

Code: Select all

for f in *.jpg
do convert $f -filter lanczos -resize 200% -threshold 63% -density 600x600 -compress Group4 600bwtif/$f.tif

The 600bwtif is sub-directory of the directory containing the images. The 200% is so that re-sampling the 300dpi images will result in images that are now 600dpi. The threshold can vary of course depending on the darkness/contrast of the original image but most seem to fall in the range of the mid-50s to the mid-70s. I test various settings on single images before running the batch job. The single image conversion script is this:

Code: Select all

convert filename.jpg -filter lanczos -resize 200% -threshold 63% -density 600x600 -compress Group4 filename.jpg.tif

Once converted I then run them through Scan Tailor which will de-skew the images and set uniform margins. After that images that need it get manually cleaned in Photoshop. It is possible to batch process the original jpg images in Scan Tailor and have it re-sample the images to 600dpi, de-skew them, set uniform margins, and convert them to black and white. Scan Tailor's resulting tif images are compressed using LZW but can be converted to CCITT Group 4 fax compression during the PDF creation process.

Perhaps I'm missing something but from what I've been able to determine there is no way for the user to control the black/white threshold setting in Irfanview. To me, that is a deal breaker.

Re: Grayscale to B&W images

Posted: Sun Aug 31, 2014 3:02 pm
by Marceloh.
Unfortunatelly, the BnF sheet music scanning procedure is to make grayscale tiff images. I don't have enough knowledge about the best procedure to convert this kind of images to B&W images.
Concerning my own printed sheet music, I always scan them to make 600dpi B&W images.

Re: Grayscale to B&W images

Posted: Mon Sep 01, 2014 3:10 am
by cypressdome
The Imagemagick method will work with tiff/tif files and a great many other file types. You just have to change the file extension in the scripts to tiff or tif as the case may be. I used jpg in the example because the 300 and 400dpi files (color and grayscale) that I have been able to download form BNF have been in jpg format.