[comp.graphics] Upgrade PBM to PGM or PPM: opinions wanted.

pokey@well.UUCP (Jef Poskanzer) (06/26/88)

I'm thinking about upgrading my portable bitmap toolkit so that it has
additional tools for handling grayscale pixmaps (graymaps) as well.
I don't currently have any graymaps, but the Usenix FaceSaver data will
probably be released soon.  This contains over 2000 images, each about
150 x 250 pixels and 8 bits deep.  That's about the same amount of data
that I currently have in my bitmap collection, and I will need some tools
to manipulate it.

As I see it, the new toolkit will include:

 - A minor but incompatible change to the PBM format: I want to add a "magic
   number" at the beginning.  This is because some of the tools will be
   able to handle either bitmaps or graymaps, and they have to be able to
   tell which is which.  Unless someone has a better idea, I'll use the
   characters "P1".

 - A new file format for graymaps (magic number "P2").

 - The usual assortment of format conversion filters.

 - A tool for converting from graymaps to bitmaps (or graymaps of smaller
   depth), via Floyd-Steinberg, dithering, half-toning, thresholding, or
   whatever.  (I can crib most of this code from the 'xim' program.)

 - Upgrading any applicable PBM tools to handle graymaps.  E.g. pbmcut
   and pbmpaste.

 - A tool for re-sampling graymaps into different sizes and shapes.

 - A convolution filter.

 - ???  You tell me.

Some considerations:

 - Handling direct color pixmaps would not be much more code than graymaps;
   handling color-mapped pixmaps would be a lot more code.  But it's probably
   worth doing both.

 - DO I NEED TO DO THIS?  There must be tools already out there that
   do stuff like this.

Your opinions are solicited.
---
Jef

              Jef Poskanzer   jef@lbl-rtsg.arpa   ...well!pokey
                          "Well, I'm back," he said.

sow@eru.uucp (Sven-Ove Westberg) (06/30/88)

In article <6377@well.UUCP> Jef Poskanzer <jef@rtsg.ee.lbl.gov> writes:
|I'm thinking about upgrading my portable bitmap toolkit so that it has
|additional tools for handling grayscale pixmaps (graymaps) as well.
|As I see it, the new toolkit will include:

| - DO I NEED TO DO THIS?  There must be tools already out there that
|   do stuff like this.

Your right, it exists a good tool for this. 

I suggest that you take a close look on "The IM Raster Toolkit" from
University of Waterloo, written by A. W. Paeth.


Sven-Ove Westberg, CAD, University of Lulea, S-951 87 Lulea, Sweden.
Tel:     +46-920-91677  (work)                 +46-920-48390  (home)
UUCP:    {uunet,mcvax}!enea!cad.luth.se!sow
ARPA:    sow%cad.luth.se@ucbvax.berkeley.edu  (only dumb ARPA mailers)
Bitnet:  sow%cad.luth.se@sekth
Internet: sow@cad.luth.se