[magick-users] Despeckling images for OCR and anti-spam purposes

Kelly Jones kelly.terry.jones at gmail.com
Sat Dec 23 00:05:07 CST 2006


Spammers are starting to put "speckles" in their images to defeat
OCR-scanning plugins such as FuzzyOCR.

I thought ImageMagick's -despeckle option would help, but it doesn't
seem to, not even when applied multiple times, not even in conjunction
with -monochrome.

I want a filter that does this for each pixel X:

1) if any of X's 8 neighbor pixels is the same color, turn X black
2) otherwise, turn X white

Can some combination of options to convert do this?

I realize that:

1. This will only work w/ indexed-color images (eg, GIFs) and not JPEGs, etc.
2. Spammers will soon work around this, so this is just a short-term bandage.
3. I could write something in libgd to do this (blech!)

-- 
We're just a Bunch Of Regular Guys, a collective group that's trying
to understand and assimilate technology. We feel that resistance to
new ideas and technology is unwise and ultimately futile.


More information about the Magick-users mailing list