Path: utzoo!attcan!uunet!cs.utexas.edu!usc!apple!sun-barr!newstop!sun!wind.Eng.Sun.COM From: naughton@wind.Eng.Sun.COM (Patrick Naughton) Newsgroups: comp.windows.news Subject: Re: writecanvas and bw ? Message-ID: <140126@sun.Eng.Sun.COM> Date: 3 Aug 90 16:56:30 GMT References: <1990Aug1.154745.7682@shearson.com> Sender: news@sun.Eng.Sun.COM Reply-To: naughton@wind.Eng.Sun.COM (Patrick Naughton) Organization: Sun Microsystems, Inc. - Mountain View, CA Lines: 30 In article <1990Aug1.154745.7682@shearson.com>, fgreco@slcpi.shearson.com (Frank Greco) writes: |> |> Does anyone know how to make writecanvas write out |> 1-bit bw images instead of 8-bit color images? |> |> In effect, I'd like to run rasfilter8to1(1) on the |> image before it gets written out. |> |> |> Thanks all, |> |Frank D. Greco - Consultant There is no option to writecanvas to do this per se, but this should work. /ccan (/tmp/foo.im8) readcanvas def ccan setcanvas matrix currentmatrix % figure out how big the color canvas is. dup 0 get exch 5 get % w h 1 [] null buildimage setcanvas % create a mono canvas the same size. ccan imagecanvas % copy the color canvas onto the mono one. (/tmp/foo.im1) writecanvas % write the mono canvas. -Patrick ______________________________________________________________________ Patrick J. Naughton ARPA: naughton@sun.com Window Systems Group UUCP: ...!sun!naughton Sun Microsystems, Inc. AT&T: (415) 336 - 1080