[comp.windows.x] xwd & xwud

harkcom@spinach.pa.yokogawa.co.jp (04/16/91)

I've just recently started using xwd to dump my root window. I decided
to change it to reduce the size of the colormap to only those entries
which are actually used in the map.

In doing so I came across a lot of problems and now have many questions:

--  Why does xwd save the entire colormap in the first place?

It appears to be very easy to eliminate all colors which do not appear
in the image...

--  Why does xwd have a member for the number of entries and the number
      of colors if they will always be the same?

If there was no intention of reducing the colormap, then it doesn't
make sense to have both ncolors and colormap_entries...

--  Why does xwud read the colors in order and ignore the pixel value
      when reconstructing the image?

This causes an image to be displayed with the colors distorted unless the
entire colormap is included...

--  Why do many clients in the pbmplus tool package use the number of
      entries instead of the number of colors when reading an image?

Things like xwdtoppm die because they expect more colors than are actually
in the image...


   I write the number of colors in both ncolors and colormap_entries
to be able to use pbmplus. To be able to use xwud, I have to convert
all of my data and the pixel values in my colormap to be in order...

Al