Hello, I have scans from several books that are 600ppi B&W images. Sometimes the scanner picks up 1x1 pixels of black on the pages, and also 1x1 pixels of white within printed letters.
I would like to "despeckle" the images so the 1x1 pixels are filled to the color of their surrounding pixels. I have tried using the -despeckle operation with "convert," but it seems that this operation was meant for low-contrast spots rather than isolated black and white images.
Any ideas about how this could be done with convert? I still need to keep the shape of the letters in good order, so I don't want to distort them in the process with any radical changes...
And thank you for any replies, in advance.
Despeckling B&W Image?
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Despeckling B&W Image?
A sample image would be helpful. The solution is probably "-morphology erode" to remove the white pixels, and "-morphology dilate" to remove the black pixels.
snibgo's IM pages: im.snibgo.com
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Despeckling B&W Image?
There is also a morphology smooth that does both and open and a close