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?
Process scanned image; Threshold; Antialias
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Process scanned image; Threshold; Antialias
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
I'm trying to get a good picture out of files like
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.
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.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Process scanned image; Threshold; Antialias
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
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.
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
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, ...)
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Process scanned image; Threshold; Antialias
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.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.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Process scanned image; Threshold; Antialias
I don't know much about PDF optimization. See http://www.imagemagick.org/Usage/formats/#pdfGerenuk 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, ...)
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.