Page 1 of 1

Removal of halftone

Posted: 2007-02-23T05:01:25-07:00
by Ivar Snaaijer
Is there a way to remove this kind of halftone speckles from images with convert ?
I tried with -despeckle but that did not work as the speckles are way too big.
The distribution of the dots is rather uniform so I was thinking of changing the parameters of despecle, but there are none ...
Image

Re: Removal of halftone

Posted: 2007-02-23T13:44:27-07:00
by Ivar Snaaijer
I have been trying around and from an other pice of the forum i took this :

Code: Select all

convert in.png -blur 0x2 -threshold 50% out.png
And it gives a reasonable OCR'able picture. (that was also something we wanted to do) but it wrecks havoc on other parts of the image.

Image
I also tried :

Code: Select all

convert in.png -median 2  out.png
Image

the first combination is a bit faster than the second.

Re: Removal of halftone

Posted: 2007-02-25T16:51:13-07:00
by anthony
The technique you are talking about is called descreening.

The best solution however involved converting images to and from a Fast Fourier Transform, whch allows you to isolate the regular pattern in the image, (frequency) and remove it, thus removing that specific halftone.

A good artical on this is a PDF document by Gernot Hoffmann
http://www.fho-emden.de/~hoffmann/fft31052003.pdf

However FFT transformations has as yet not been implemented in ImageMagick.
It is a shame as the same transform also provides ways of finding very large scale
sub-image matching. For example find the cross hairs.

Re: Removal of halftone

Posted: 2007-03-06T14:08:00-07:00
by el_supremo
Would the "inpainting" feature of this program do what you want?
http://www.greyc.ensicaen.fr/%7Edtschum ... ation.html

I haven't figured out how to use it and there doesn't seem to be much documentation.

Pete

Re: Removal of halftone

Posted: 2007-03-06T22:03:47-07:00
by anthony
The algorithm descption appears to be act little like an -adaptive-blur in may situations, though as I have not studied the adaptive algorithms for demostartions in IM examples I could say just how simular they are.

Some of the examples on the link page however is very impressive, such as the cartoon and desert examples, The latter brings up details that was previously swamped by the noise that was in the image.

Others like removing JPEG blocks definatally appear more like an adaptive-blur.

I would like to see more of this algorithm, as it is a definate canadate to reverse engineer into ImageMagick.