Xref: utzoo alt.sys.sun:4440 comp.graphics:18933 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!convex!texsun!cronkite!exodus!peregrine!falk From: falk@peregrine.Sun.COM (Ed Falk) Newsgroups: alt.sys.sun,comp.graphics Subject: Re: 32Bit Sunraster to B&W Keywords: Sun, Sunraster to B&W, Help Message-ID: <16045@exodus.Eng.Sun.COM> Date: 1 Jul 91 00:11:49 GMT References: <620@wybbs.mi.org> Sender: news@exodus.Eng.Sun.COM Followup-To: alt.sys.sun Organization: Sun Microsystems, Mt. View, Ca. Lines: 32 In article <620@wybbs.mi.org> kuyp@wyn386.mi.org@wybbs.mi.org (kuyp@wyn386.mi.org) writes: > >I am looking for a method to convert 32 Bit color Sunraster files to >Black & White Images. These Images have to look good!? > >I can and have converted them to 4 eight bit images and picked the >best looking B&W, but would like a more exact way, you do not always >get a good looking image from just one color. I'm confused, are you trying to get 8-bit greyscale out or 1-bit monochrome? In the former case, the FAQ list mentions that the customary function is .299r + .587g + .144b These numbers were invented the the NTSC (national television standards committee?), but you can get reasonable results with just r/3 + g/3 + b/3 if you're lazy. In a 32-bit sunraster file, the high-order byte is alpha, and can be ignored. The low order three bytes are either rgb (blue lowest) for format RT_FORMAT_RGB or bgr (red lowest) for RT_STANDARD. To convert to a 1-bit monochrome picture, first convert to greyscale and use one of the "dithering" techniques described in Foley & VanDam. Software to do all this can be found in the pbm and fbm packages. See the FAQ list. -ed falk, sun microsystems sun!falk, falk@sun.com In the future, somebody will quote Andy Warhol every 15 minutes.