============================================================================ ###### ###### # # #### # # # # #### # # ## #### # # # # # # ## # # # # # # # # # # # # ###### # # # # # # # #### ###### # # # #### # # # # # # # # # # # ###### # # # # # # # # ## # # # # # # # # # # # ###### #### # # #### #### # # # #### # # ============================================================================ pbmplus - A collection of portable bitmap utilities. Theses tools are grouped by the file formats they handle. At the end of this file is a tutorial lesson that walks you through the steps needed to add your picture to all the e-mail messages you send. pbm: Handles the following black&white formats: Sun icon file reading writing X10 and X11 bitmap file reading writing MacPaint reading writing CMU window manager format reading writing MGR format reading writing Group 3 FAX reading writing GEM .img format reading writing Bennet Yee's "face" format reading writing Atari Degas .pi3 format reading writing Andrew Toolkit raster object reading writing Xerox doodle brushes reading ASCII graphics writing HP LaserJet format writing GraphOn graphics writing BBN BitGraph graphics writing Printronix format writing Gemini 10x printer format writing Epson printer format writing Unix plot(5) file writing Zinc Interface Library icon writing pgm: Handles the following grayscale formats: Usenix FaceSaver(tm) file reading writing FITS reading writing Lisp Machine bit-array-file reading writing raw grayscale bytes reading HIPS reading PostScript "image" data reading ppm: Handles the following color formats: GIF reading writing IFF ILBM reading writing PICT reading writing Atari Degas .pi1 format reading writing XPM (X Window System ASCII pixmaps) reading writing PC Paintbrush .pcx format reading writing TrueVision Targa file reading writing HP PaintJet format reading writing Abekas YUV format reading writing MTV/PRT ray-tracer output reading QRT ray-tracer output reading Img-whatnot file reading Xim file reading Atari uncompressed Spectrum reading Atari compressed Spectrum reading NCSA Interactive Color Raster writing X11 "puzzle" file writing Motif UIL icon file writing DEC sixel format writing AutoCAD slide format reading writing AutoCAD DXB format writing pnm: Handles the following multi-type formats: Sun raster file reading writing TIFF reading writing X11 window dump file reading writing X10 window dump file reading PostScript writing Creating an X-Face: ------------------- You can attach a small picture of yourself to your outgoing mail using the X-Face header. If the recipient is also using MediaMail, your face will show up in the message-reading window instead of the letter-and-envelope icon. A few other mail programs also display X-Faces. To make your own X-Face, you need an image of yourself and some tools for manipulating bitmaps. You have to convert the picture to be black and white and exactly 48x48 pixels in size. Let's run through an example assuming that you have an image in GIF format and you're using the freely-available PBMPLUS toolkit combined with the Indigo Magic tools on your IRIS workstation. Taking your picture: -------------------- Assuming you have an Indy equipped with an "IndyCam", double click on the "camera" icon (or enter the command "capture"). Capture lets you take still images (or pictures) you can then print, integrate with presentations, or paste up on your screen. Next, choose the "35mm camera" from the graphical menu (the graphical menu appears in the lower left corner of the application). Make sure the lens cap is open, arrange yourself in front of the camera (well lighted, of course). Adjust the settings or rename your picture using the Image Settings window (choose "Settings" from the Actions menu). Click "Record" to save the image. Your image is saved to a file called "capture.rgb" in your home directory ("capture.rgb" is the default name for any image you save). When you save another image it writes over the file. See "Adjusting Picture Settings" to rename your image file. If you don't have access to a camera or video input device, you can always scan in a image from a picture or read one from a PhotoCD. At this point, you may want to use an image editor, like "imgworks" or "imged" or "PhotoShop" to edit the file. Remember, the final "face" will be displayed as a 48x48 pixel black and white bitmap. So you might want to crop the image to include only your face and perhaps edit out the background, etc. When you are happy with the image, you'll need to convert it to the GIF file format before proceeding: togif capture.rgb face.gif Note: 'togif' may be found in the 'eoe2.sw.imagetools' subsystem. Processing the image data: -------------------------- Then, a series of image processing steps are done to the image file to convert it to grayscale and scale it to the desired size. Note, in the following descriptions, you may simply string together all the commands into one long line (such as: giftoppm face.gif | ppmtopgm | etc.): giftoppm face.gif | \ # convert to PPM ppmtopgm | \ # color to grayscale, if necessary pgmnorm | \ # normalize grayscale contrast pnmscale -xy 48 48 | \ # scale to at most 48x48 pgmtopbm > face.pbm # convert to PBM At this point you have an Nx48 or 48xN bitmap, and you have to make it square. There's no simple pipeline to do this, but here's one way: pnmfile face.pbm # look at size face.pbm, e.g.: # PBM raw, 37 by 48 bc (48 - 37) / 2 # compute x offset for paste 5 pbmmake -white 48 48 | \ # make white background bitmap pnmpaste face.pbm 5 0 | \ # paste in the face pbmtoicon | \ # convert to Sun icon format tail +3 | \ # remove unnecessary header stuff compface > face.xface # convert to X-Face Inserting the image data into MediaMail: ---------------------------------------- This produces a string such as: ,Ds44dHMpgZWe_mQHw>6_G=nh*w!PSv@Pn"}Q4{q}~^Zwt`4_"awA If the string is more than one line, join the lines and remove blanks. Replace any single quotes with single double single double single ('"'"'): ABC'123 becomes ABC'"'"'123 Then wrap that in a "my_hdr" command using single quotes: my_hdr X-Face: `,Ds44dHMpgZWe_mQHw>6_G=nh*w!PSv@Pn"}Q4{q}~^Zwt`4_"awA' Insert this line into your MediaMail resource file (jot ~/.zmailrc) like this: # # mail headers for outgoing mail # my_hdr X-Face: `,Ds44dHMpgZWe_mQHw>6_G=nh*w!PSv@Pn"}Q4{q}~^Zwt`4_"awA' Save the resource file and then restart MediaMail to have the changes you have just made take effect. Then, try sending yourself an e-mail message and see what you look like!