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