Binary Floyd Steinberg Dithering - Image Completely Black

Bugs found in XnView Classic. Please report only one bug per topic!

Moderators: helmut, XnTriq, xnview

Post Reply
daryle
Posts: 4
Joined: Thu Oct 18, 2007 11:18 pm

Binary Floyd Steinberg Dithering - Image Completely Black

Post by daryle »

OK so this is very strange. There seems to be some unusual bug in the Floyd Steinberg Binary dithering routine. I have a bunch of *very* large tif scans (150-200 MB) that I am cropping and converting to monochrome (~1/200 the size). I was cruising along and after about a dozen or so ran into at least two where when some portion is selected the FS dithering routine outputs a completely black image. I tried playing around and it's some strange confluence. On one it does it uncropped and keeps on going until some section of around 1/2 or less is selected; of course it could be some section that is the problem rather than amount. On the other it actually works fine uncropped and then does is when the boarder has been cropped away.

Ideas?
daryle
Posts: 4
Joined: Thu Oct 18, 2007 11:18 pm

Re: Binary Floyd Steinberg Dithering - Image Completely Blac

Post by daryle »

So while this is still probably a bug I was correct on a hunch I had about the cause and confirmed a bit of a workaround.

The images have a lot of background pattern (vellum fabric) that is basically noise to any algorithm. When this is coupled with a drawing that has a lot of fine line design work the algorithm chokes. I also found a couple now where is succeeds but a lot of the pen detail is lost. The quick solution, without spending a lot of time on image processing and restoration, seems to be to do a "Reduce noise" first. This cleans things up enough with with the substrate pattern "noise" for the FS dithering to do a decent job on the larger scale lines. I might go back and try this on some of the ones that I thought looked good the first time around.
daryle
Posts: 4
Joined: Thu Oct 18, 2007 11:18 pm

Re: Binary Floyd Steinberg Dithering - Image Completely Blac

Post by daryle »

So at the risk of having a conversation with myself :-) ....

Sort of as expected using NR first when it isn't necessary doesn't really help; if anything it might make things a bit worse as you would typically expect in cascading filters.
User avatar
Drahken
Posts: 884
Joined: Sun Apr 10, 2005 4:29 pm

Re: Binary Floyd Steinberg Dithering - Image Completely Blac

Post by Drahken »

As a workaround, you could try using an external filter to achieve the b/w dithering, this is a powerful one: http://newsgroup.xnview.com/viewtopic.php?f=38&t=18106
For monochrome, set the grey levels to "2". Beyond that, play around with the different options & see what gives you the best results.

The one drawback is that this filter doesn't actually convert the image to monochrome format, it just reduces the number of colors used in the image. After applying the filter, go to image->convert to binary->no dither, this will convert it to monochrome format without messing up the dithering you already did.

Here's a sample I threw together trying to recreate your problem (though I wasn't able to recreate it):

Full color
Binary-> floyd
Graydither filter

I didn't spend much time tinkering with the many settings in the graydither filter, but the results were still pretty good.



Another thing you might try is adjusting the levels and/or gamma/sat/contrast/brightness before converting to binary. If you can get the key parts past the cutoff threshold, that might solve your problem.
Oh the feuhrer, oh the feuhrer, oh the feuhrer's nipples bonk!
Post Reply