waigani
waigani

Reputation: 3580

imagemagick remove clusters of pixels

Original image:

enter image description here

I want to isolate and remove (i.e. turn to white) small clumps of pixels with large amounts of white space around them. Examples of pixel areas I would like to turn to white:

enter image description here

The goal is to get larger unbroken areas of white space. Example of the final result:

enter image description here

Upvotes: 3

Views: 2593

Answers (1)

Michal M
Michal M

Reputation: 1568

Small clusters of pixels can be filtered out using the median filter with imagemagick like this:

convert gmyjf.jpg -median 5 gmyjf2.jpg

(where gmyjf.jpg would be the path to the original file)

Upvotes: 2

Related Questions