Image Monoifier author Neil Franklin, last modification 2005.03.19 Take in an 3*8bit JPG image as produced by an scanner or digicam, or one already converted to 8bit grayscale or directly recorded like that. Convert it to an 1bit black/white (no grays) image. Use for scans/photos of what was once intended to be black on white printed matter, i.e. is as far as the data concerns just an digital 1bit image, but due to printig .. scanning/photographing has become an analog 8bit scatter of gray levels. In particular if the original was already misstreated by photocopying or even by bad printing process in the first place. Do conversion so that gray levels are split into back and white as sensible as possile. So threshold should be derived from the image (not just 50%, 128). Should take into account that non optimal lighting (in particular in photos) can darken white or lighten black. And that lighting can vary over the entire page. And can vary more than the remaining difference of black and white. For this compute threshold from average lightness of the near vincinity (how far?). But also take into account that large pieces of one colour do not get artificially split up into an near-random pattern.