Page 1 of 1

Process scanned image; Threshold; Antialias

Posted: 2010-01-16T09:42:48-07:00
by Gerenuk
I want to process a scanned imaged with black and white block adjusted text.

Which is the best command to set thresholds (i.e. reduce text from the opposite page shining through)?

Next I'd also like to add some artificial antialiasing for the letters that are already pixels. Which is the best command for that?

And finally I need to get the text centered on a A4 page (equal margins). I suppose I have to use another tool for that. Any suggestions?

Re: Process scanned image; Threshold; Antialias

Posted: 2010-01-16T11:55:14-07:00
by fmw42
can you post a link to an example image. it is hard to tell what your issues might be for thresholding, etc.

Re: Process scanned image; Threshold; Antialias

Posted: 2010-01-16T13:20:00-07:00
by Gerenuk
I'm trying to get a good picture out of files like
Image

I played around with gimp, but ended up with inconsistent manipulations and looks. Also it tend to be quite high contrast and ugly letters so I hoped it would be possible to antialias somehow.

Btw: I discovered -deskew which was rly helpful.

Re: Process scanned image; Threshold; Antialias

Posted: 2010-01-16T13:27:19-07:00
by fmw42
If you are on Linux or Mac (Unix), then you might want to try my script, textcleaner. See link below

Re: Process scanned image; Threshold; Antialias

Posted: 2010-01-16T13:34:22-07:00
by Gerenuk
Thanks a lot! I'll look at the script. I guess there are parameters to play around.
Could you guess the order of commands (just names, no parameters) which I will going to need?

Since you have dealt with text processing: how would suggest to center the block text on a standard A4 page? My best guess was to somehow mark the text boundary by hand (some special box in gimp?) and then place this image on a clean A4 page.

Re: Process scanned image; Threshold; Antialias

Posted: 2010-01-16T13:37:10-07:00
by Gerenuk
Btw, my next challenge will be to add these images in full 300dpi into a PDF. Is there any way to save space while doing that? (special option, have lineart only, ...)

Re: Process scanned image; Threshold; Antialias

Posted: 2010-01-16T15:31:22-07:00
by fmw42
Gerenuk wrote:Thanks a lot! I'll look at the script. I guess there are parameters to play around.
Could you guess the order of commands (just names, no parameters) which I will going to need?

Since you have dealt with text processing: how would suggest to center the block text on a standard A4 page? My best guess was to somehow mark the text boundary by hand (some special box in gimp?) and then place this image on a clean A4 page.
In my script textcleaner, you can unrotate. Then take the output and use -extent to pad out to your A4 pixel size. You could also create an white A4 page and then composite the result from the script into the center. I don't know much about setting page sizes in those formats. But see http://www.imagemagick.org/script/comma ... s.php#page it will tell you the corresponding pixel dimensions.

Re: Process scanned image; Threshold; Antialias

Posted: 2010-01-16T15:33:12-07:00
by fmw42
Gerenuk wrote:Btw, my next challenge will be to add these images in full 300dpi into a PDF. Is there any way to save space while doing that? (special option, have lineart only, ...)
I don't know much about PDF optimization. See http://www.imagemagick.org/Usage/formats/#pdf

If your images are line art in b/w, then you might want to convert your images to -type grayscale or -type bilevel before converting to PDF.