home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / windows / x / 15300 < prev    next >
Encoding:
Internet Message Format  |  1992-08-16  |  1.6 KB

  1. Path: sparky!uunet!decwrl!bu.edu!wang!news
  2. From: amoss@huji.ac.il (Amos Shapira)
  3. Newsgroups: comp.windows.x
  4. Subject: Re: need help with images
  5. Message-ID: <amoss.714046326@falafel>
  6. Date: 17 Aug 92 10:12:06 GMT
  7. References: <BsILsB.E3D@wpi.WPI.EDU> <5480@ucsbcsl.ucsb.edu>
  8. Sender: news@wang.com
  9. Organization: Mail to News Gateway at Wang Labs
  10. Lines: 30
  11.  
  12. 6500mack@ucsbuxa.ucsb.edu (Michael P. Mack) writes:
  13.  
  14. >In article <BsILsB.E3D@wpi.WPI.EDU> danielg@oconnor.WPI.EDU (Daniel Matthew Gaines) writes:
  15.  
  16. >>i've got a greayscale  image made up of 16 bit pixels that i want
  17. >>to convert to an XImage.  the problem is that when i go
  18. >>to XPutImage i have a drawable of 8 bits (i am not able to
  19. >>get a depth of 16)  so when i do the XCreateImage i try
  20. >>using 8 for a depth but, as expected, the image is trashed when it appears.
  21.  
  22. >You will need to rescale your image data so that each value is in
  23. >the range 0..255 (ie 8 bits) and convert to unsigned char.
  24. >A simple way is to just remove the lower byte of each pixel value, but if
  25. >the result is lousy (because of poor contrast) then you could try an approach
  26. >like this:
  27.  
  28. [ deleted ]
  29. >You probably won't notice any degradation due to the compression since the
  30. >human eye can distinguish only roughly 40 grey levels anyway.
  31.  
  32. I'm absolutly NOT an Images or Xlib expert, but a basic approach which might
  33. help enhancing your scaled images would be to do some statistics about the
  34. freuqency each colour is used and remove the ones which are used less.
  35.  
  36. Hope this helps,
  37. --
  38.  
  39. --Amos Shapira (Jumper Extraordiner)
  40. C.S. System Group, Hebrew University, Jerusalem, Israel
  41. amoss@cs.huji.ac.il
  42.