Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!decwrl!decvax!tektronix!reed!elbaum From: elbaum@reed.UUCP (Daniel Elbaum) Newsgroups: comp.sys.amiga Subject: Re: grey scale --> HAM picture Keywords: grey gray dither Message-ID: <11758@reed.UUCP> Date: 13 Feb 89 03:06:40 GMT References: <6432@thorin.cs.unc.edu> <19763@agate.BERKELEY.EDU> <338@lakesys.UUCP> Reply-To: elbaum@reed.UUCP (Daniel Elbaum) Organization: Reed College, Portland OR Lines: 46 In article <338@lakesys.UUCP> mikes@lakesys.UUCP (Mike Shawaluk) writes: >In article <19763@agate.BERKELEY.EDU> c60a-1fy@web-2a.berkeley.edu (Anon) writes: >>In article <6432@thorin.cs.unc.edu> skinner@unc.cs.unc.edu (Andrew Skinner) writes: >>> >>>I'd like to be able to convert picture files produced at school to HAM >>>mode pictures, to be displayed [as monochrome images]. >> >>There are only 16 shades of grey in the palette anyway, [so] ham won't >>gain you anything. > >HAM won't buy anything in regard to viewing grey-scale images >[but] additional grey shade can be generated by dithering. If your image is 320 x 200, you can get 60 shades of grey. Allocate a hi-res screen, and use a 2 x 2 pixel square (call it a tetrad) for each pixel in the original image. Each element of the tetrad can take on any of 16 shades of grey. Varying the shade of one tetrad element (tetrel?) would result in a small incremental change in the shade of the whole tetrad. To the eye (I've tried this) the pixels within the tetrad disappear, so that the smallest apparent element of the picture is the tetrad rather than the pixel. It's like building four stacks of coins so that they're all about the same height. If you have 64 coins and can't put more than 16 in a single stack, you start by laying down one coin, then one beside it, then one below the first, then one below the second, so you have a square. Then repeat the process, so eventually you have a 2 x 2 square of coins 16 coins deep. Each time you put down a new coin, you increase the total number of coins by one. But you don't get 64 shades of grey on the screen, since you can't have a zero-bit-plane display. In other words, you really only have 15 coins for each stack. Since you get four increments in tetrad value for each pixel value, you end up with 60 shades of grey. I used this technique to display character-graphics pictures (you know, the pinups made up of ASCII characters) with very good results. Resolution does suffer, but the shading turns out nicely. -- : Daniel Elbaum Responsible for all : tektronix!reed!elbaum disclaimed postings : elbaum@reed.bitnet