Re: [gtk-list] how to encode for 256 color pixmap?



On Wed, 13 Oct 1999 10:30:26 +0800, shigang wrote:
>      I have a pixmap file which have 256 grey colors. Because of using ASCII
> code, each pixel is 
> 
> descibed by two characters. This make xpm file as twice larger as raw data
> file.
> 
>      Can someone tell me how to encode xpm file so each byte can instead a
> pixel?   

It can't be done: ASCII is a 7 bit character set, 256 colors needs 8 bits,
so you need two bytes to encode it.

Try to remap your pixmap to 60-80 grey levels, the human eye is not able
to distinguish more grey levels. Use dithering when you reduce the number
of levels, or you might get false contours in your image (depends on the
image).


Erik

-- 
J.A.K. (Erik) Mouw, Information and Communication Theory Group, Department
of Electrical Engineering, Faculty of Information Technology and Systems,
Delft University of Technology, PO BOX 5031,  2600 GA Delft, The Netherlands
Phone: +31-15-2785859  Fax: +31-15-2781843  Email J.A.K.Mouw@its.tudelft.nl
WWW: http://www-ict.its.tudelft.nl/~erik/




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]