Displaying color backgrounds under SunView

David L. Kensiski oahu!bcshaw!airport8!dkensis at sunkist.west.sun.com
Wed May 2 06:30:19 AEST 1990


In a recent Sun-Spots issue, Patrick Goebel <romeo at lindy.stanford.edu>
writes:

> I was told (and later verified myself) that sunview will not display
> color backgrounds using the -background option

Quite correct.  It's sad but true, you cannot display color images with
the -background option to SunView.  There are two things, however, that I
know of that you can do:

    (1)	Use bgtool to display the color image
    (2) Convert the image to monochrome

Option (1) seems the best, but the problem is that I can't seem to find
bgtool in my index of ftp sources.  We had a copy of it when I worked for
Martin Marietta, but I don't know where we got it.  If you can ftp, you
might want to poke around the sites offering Sun source and see if you can
find it.

Bgtool had a limitation, anyway.  It appears that bgtool tries to use all
256 entries in your colormap.  If you have any windows that also use your
colormap, these colors will take precedence.  When this happens, you will
get strange colors in your exotic living-color backgrounds.  It's probably
possible to fix this in the bgtool code by not allowing it to use
colorcells that are already allocated.  Note, however, that I have used it
on living-grayscale backgrounds with 100% success.

Option (2) will allow you to use the -background switch on SunView.  This
is best accomplished by getting a copy of Jef Poskanzer's
<pokey at well.sf.ca.us> pbmplus package, which will let you do a ton of
things, including convert color images to monochrome.  This package
applies the "boustrophedonic Floyd-Steinberg error diffusion" (right out
of the man page) algorithm for converting to monochrome, which is a far
cry better than the ordered dithering or thresholding used in Sun's
rasfilter8to1.

Another benefit you will reap from pbmplus will be the ability to convert
to and from a whole herd of different image formats.  You will also get
the ability to enlarge an image using a nifty error diffusion algorithm
rather than simple pixel replication, making a much nicer enlarged image
than you can get with Sun's rastrepl program.

You can usually ftp the pbmplus package from rtsg.ee.lbl.gov
[128.3.254.68, as of 12/21/90 (sic)].  Even if you don't want to convert
images to monochrome, it's other capabilities make this is a most
excellent package.

I have also heard of a package called fbm (fuzzy bitmaps) that is supposed
to sit atop pbmplus, or something like that, but I have not used it.

David L. Kensiski	sunkist.west.sun.com!oahu!bcshaw!dkensis
Boeing Computer Services



More information about the Comp.sys.sun mailing list