Subject: Color images and color maps

From: Chris Liebman <[email-masked]>
Date: Tue, 15 Feb 1994 22:11:04 -0500 (EST)

Hi,
   I have been thinking about supporting other image file formats in
XFaces (its on the TODO list) and the problem of restricting the number
of colors comes up, as well as what formats to support.  My initial
thoughts are to embed some image processing functions into XFaces so
that no matter what colors or how many colors an image wants we always
reduce/dither the image to use a specific set of colors.  An idea that
occurred to me while I was digging out from a recent snow storm was to
allow reading reading from a filter program down a pipe. This way any
format that could be converted into a "native" format could be used. 
You could register the new types with something like:

XFaces.xpmFilterCount:	2

XFaces.xpm1.name:	gif
XFaces.xpm1.filter:	giftopnm %% | ppmquant  -map cmapfile | ppmtoxpm
XFaces.xpm1.extension:	.gif

XFaces.xpm2.name:	tiff
XFaces.xpm2.filter:	tifftopnm %% | ppmquant  -map cmapfile | ppmtoxpm
XFaces.xpm2.extension:	.tiff

This should not be *too* hard to implement as all of the processing is
already done in the external converters.  This would allow XFaces to
read a *bunch* of formats right off the bat and the ppmquant filter
could force all of the images to use the same colormap.  This would not
affect any images loaded directly using the native xpm support.  If
those files did not need shape support then we could define another
external filter:

XFaces.xpm2.name:	xpm2
XFaces.xpm2.filter:	xpmtopnm %% | ppmquant  -map cmapfile | ppmtoxpm
XFaces.xpm2.extension:	.xpm

Ideally I would like to see the color reduction and dithering done
internally so the the native xpm support could take advantage of it. 
Does anybody have any thoughts or ideas about this?  Any other color
issues?

			-- Chris
Chris Liebman		Work			Home
Internet:	[email-masked]	[email-masked]
UUCP:		uunet!xrxedds!liebman	uunet!clarknet!zod!liebman
Phone:		1-703-787-2032		1-703-830-1641

---

From: "Steve Kinzler" <kinzler>
Date: Wed, 16 Feb 1994 09:00:11 -0500

Sent 15Feb94 from [email-masked] to faces
+---------- Color images and color maps ----------
|                                                          My initial
| thoughts are to embed some image processing functions into XFaces so
| that no matter what colors or how many colors an image wants we always
| reduce/dither the image to use a specific set of colors.

Check out the READMEs/colortable file in Anthony's X Icon Library
(ftp://ftp.x.org/contrib/AIcons, http://www.cit.gu.edu.au/~anthony/icons)
for a proposed minimal colortable.  While not sufficient for XFaces'
purposes (not enough skin tones, eg), it might make a good starting point.

|                                                           An idea that
| occurred to me while I was digging out from a recent snow storm was to
| allow reading reading from a filter program down a pipe.

Nice idea.  But it'd probably still be worthwhile to build-in a few of
the most common formats (eg, GIF) for efficiency reasons.

--
from the brain of Steve Kinzler    /o)\    [email-masked]
an organ with a mind of its own    \(o/

Fine iodination / alienee schismatize abbess / Faroese timothy.