4

We have a number of line-art charts unfortunately saved as JPEGs. They are now riddled with distracting compression artifacts or "speckles". Is there any way of removing these? I do not have the original files and it will be very difficult to recreate them.

I am running Windows 7 and tried Paint.Net; none of the filters help. Posterize washed out all the colors and leaves the speckles. Blur makes text unreadable. Noise Reduction wrecks antialiasing of curved lines, and perversely enhances the speckles, making them look like checkerboards.

Yes, I have Googled for software to do this; there are many programs that advertise despeckling but, after my experience with Paint.Net, do not want to experiment with applications that show no before and after images. The only example I have seen that does what I want is from a Photoshop tutorial. I have dozens of files and the tutorial requires considerable manual fine-tuning. I would prefer to automate or batch-process this task. Commercial apps are fine, but I do not want to spend over $600 and learning a complex program for a single task.

2 Answers2

4

The GIMP has a despeckle filter.

digitxp
  • 14,884
2

I don't think you'll be able to get a perfect despeckle filter without tweaking (e.g. how can a filter know whether an "i" is really a small "l" with a speckle on top?).

However: the convert command from ImageMagick is quite powerful for batch processing. You might find a filter that works well for your purposes. Most of the before/after images for ImageMagick are for photos rather than for line drawing, so I made some from an old childhood drawing:

Input File

Running convert in.jpg -despeckle despeckle.jpg gives

enter image description here

If you flick between the two images you notice that the despeckled image is significantly less noisy. The text is also a little softer.

There are other filters you can try like '-enhance'. Note that you aren't limited to the built in filters, there are scripts for imagemagick that provide more powerful filters, for example the Kuwahara script. (a simple version of Kuwahara is also built into the latest ImageMagick)

Running kuwahara in.jpg kuwahara.jpg gives:

enter image description here

Kuwahara can do a better job of de-speckling line art because it preserves edges, which is what line art is all about. In the case of this pen drawing it also makes it look a bit like it was drawn in felt tip.

Yet more powerful filters can be developed in python. See: https://stackoverflow.com/questions/4632174/what-processing-steps-should-i-use-to-clean-photos-of-line-drawings

gmatht
  • 2,437