whitening varying shapes of four to six pixels

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
galwaylibrary
Posts: 5
Joined: 2012-05-24T02:45:58-07:00
Authentication code: 13

whitening varying shapes of four to six pixels

Post by galwaylibrary »

Hi,

I am working with an image with a lot of black marks on the background. The marks are about four to six pixels in size, but the shape varies greatly. However, all of these shapes are surrounded by a sea of white pixels. Is it possible to remove these marks?

Any help would be much appreciated.

Regards
John
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: whitening varying shapes of four to six pixels

Post by fmw42 »

You can use -morphology open or close depending upon white on black or black on white. I never remember and have to try both. see http://www.imagemagick.org/Usage/morphology/#basic

can you post a link to your example image so others can experiment?
galwaylibrary
Posts: 5
Joined: 2012-05-24T02:45:58-07:00
Authentication code: 13

Re: whitening varying shapes of four to six pixels

Post by galwaylibrary »

Hi,

Thanks for your reply. I have put the image at
http://places.galwaylibrary.ie/page.png

Regards
John
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: whitening varying shapes of four to six pixels

Post by fmw42 »

try

convert page.png -median 3x3 show:
Post Reply