Color images and color maps

Chris Liebman (
Tue, 15 Feb 1994 22:11:04 -0500 (EST)

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 gif
XFaces.xpm1.filter: giftopnm %% | ppmquant -map cmapfile | ppmtoxpm
XFaces.xpm1.extension: .gif 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: 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

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