home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / os / mswindo / programm / misc / 4841 < prev    next >
Encoding:
Internet Message Format  |  1993-01-11  |  1.3 KB

  1. Path: sparky!uunet!ogicse!news.u.washington.edu!shelley.u.washington.edu!rberteig
  2. From: rberteig@shelley.u.washington.edu (Rolf Berteig)
  3. Newsgroups: comp.os.ms-windows.programmer.misc
  4. Subject: Re: Disp 24bpp on 8bpp system?
  5. Message-ID: <1ish70INNco6@shelley.u.washington.edu>
  6. Date: 11 Jan 93 19:18:56 GMT
  7. Article-I.D.: shelley.1ish70INNco6
  8. References: <C0K4nM.14B@news.cso.uiuc.edu>
  9. Organization: University of Washington, Seattle
  10. Lines: 16
  11. NNTP-Posting-Host: shelley.u.washington.edu
  12.  
  13. >   Is there anyway to display a 24bpp DIB on a 256 color SVGA without
  14. >   implementing the code for color quantization?  I wrote some code to
  15. >   convert 24bpp images into 8bpp DIBs, but it takes around 10 seconds
  16. >   for a 512x512 DIB, and I just wonder if there is a better way.
  17.  
  18. A quick way to do this with results better than bliting (getting the 
  19. 20 system colors) but with quality still lacking is to create a standard
  20. 256 color pallet and an inverse pallet (with say 2^5 entries). To display 
  21. an image, for every pixel you take the 8 bits for red,green,blue and shift 
  22. right 3 bits (now you have 15 bit color) and use this number as an index 
  23. into your inverse color map. Your inverse color map then gives the closest 
  24. fit to your standard pallet. Now you are ready to blit your device dependent
  25. 8 bits per pixel bit map.
  26.  
  27. Rolf Berteig
  28. rberteig@u.washington.edu
  29.