home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / os / mswindo / programm / misc / 4854 < prev    next >
Encoding:
Text File  |  1993-01-11  |  1.7 KB  |  41 lines

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