Removal of halftone

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
Ivar Snaaijer
Posts: 21
Joined: 2006-02-22T09:22:30-07:00

Removal of halftone

Post 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
Ivar Snaaijer
Posts: 21
Joined: 2006-02-22T09:22:30-07:00

Re: Removal of halftone

Post 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.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Removal of halftone

Post 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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
el_supremo
Posts: 1015
Joined: 2005-03-21T21:16:57-07:00

Re: Removal of halftone

Post 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
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Removal of halftone

Post 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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply