Page 1 of 1

Removing "checks" dithering

Posted: 2019-10-11T19:48:34-07:00
by BenjaminKim
Hello,

I have monotone images being generated outside of IM, and contain what's effectively the "ordered-dither=checks" dithering.

I've been trying to figure out a way to remove such dithering - what I'd like is to make any/all instances of such dithering fully black.

Example file is (Group 4 monochrome tiff):

https://drive.google.com/open?id=1hLP9h ... rjohtvWF82

And here is the up-close zoom of the dithering:

https://drive.google.com/open?id=1KqdK1 ... rECwvxYoV4

https://drive.google.com/open?id=14CBgt ... tyU-91jdNP

https://drive.google.com/open?id=1IGtFX ... 0vLY8hqMZ0


Ultimately, where dithering exists, I'd like to make it black. In the third close-up, I'd want to make it black up until there is a solid area of white.

I've been trying to leverage morphology to accomplish, but not having much luck. Any input or thoughts is greatly appreciated.

Re: Removing "checks" dithering

Posted: 2019-10-11T21:09:53-07:00
by fmw42
One potential way is notch filtering via FFT processing. See http://www.fmwconcepts.com/imagemagick/ ... se_removal

Another way, might be to simply create a mask image that is black where the checkerboard does not exist and white where it does. Then use the mask to replace the checkerboard with a black image by 3 image compositing. See https://imagemagick.org/Usage/compose/#compose

Re: Removing "checks" dithering

Posted: 2019-10-12T05:33:37-07:00
by snibgo
How about (Windows syntax):

Code: Select all

magick ^
  001.tif ^
  ( -clone 0 -morphology HMT 3x1:0,1,0 -negate ) ^
  ( -clone 0 -morphology HMT 1x3:0,1,0 -negate ) ^
  -background None ^
  -compose Darken -layers flatten ^
  out.png


Re: Removing "checks" dithering

Posted: 2019-10-13T18:03:39-07:00
by BenjaminKim
Oh wow - perfect - thank you! I had not looked into FFT - but have definitely reviewed everything I could find you've written re Morphology. I had actually explored HMT for a bit to deal with something way earlier in the process, but ultimately took a different approach and forgot about it.

This is great - thank you so much!