home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.ms-windows.programmer.misc
- Path: sparky!uunet!mcsun!sunic!kth.se!byse.nada.kth.se!d88-jwa
- From: d88-jwa@byse.nada.kth.se (Jon WΣtte)
- Subject: Re: Disp 24bpp on 8bpp system?
- Message-ID: <1993Jan11.221350.26807@kth.se>
- Sender: usenet@kth.se (Usenet)
- Nntp-Posting-Host: byse.nada.kth.se
- Organization: Royal Institute of Technology, Stockholm, Sweden
- References: <C0K4nM.14B@news.cso.uiuc.edu> <1ish70INNco6@shelley.u.washington.edu>
- Date: Mon, 11 Jan 1993 22:13:50 GMT
- Lines: 28
-
- In <1ish70INNco6@shelley.u.washington.edu> rberteig@shelley.u.washington.edu (Rolf Berteig) writes:
-
- >A quick way to do this with results better than bliting (getting the
- >20 system colors) but with quality still lacking is to create a standard
- >256 color pallet and an inverse pallet (with say 2^5 entries). To display
- >an image, for every pixel you take the 8 bits for red,green,blue and shift
- >right 3 bits (now you have 15 bit color) and use this number as an index
- >into your inverse color map. Your inverse color map then gives the closest
- >fit to your standard pallet. Now you are ready to blit your device dependent
- >8 bits per pixel bit map.
-
- This is the way old Color QuickDraw did it on the Mac, and
- believe me, it's NOT PRETTY.
-
- However, you can implement error diffusion which calculates
- the error from one translated pixel and spreads it to
- neighbouring pixels with very little performance degradation;
- all you have to do is an extra suctraction after you get the
- color, and add that difference to the next "real" color you
- want to display. Clear the value for each scanline...
-
- Cheers,
-
- / h+
- --
- -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --
- This signature is kept shorter than 4 lines in the interests of UseNet
- S/N ratio.
-