Xref: utzoo comp.windows.x:12661 comp.sys.hp:2710 Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!usc!venera.isi.edu!raveling From: raveling@venera.isi.edu (Paul Raveling) Newsgroups: comp.windows.x,comp.sys.hp Subject: Re: Converting RGB grey scale pictures into dithered patterns. Message-ID: <9386@venera.isi.edu> Date: 21 Aug 89 16:48:54 GMT References: <19183@mimsy.UUCP> Reply-To: raveling@venera.isi.edu (Paul Raveling) Organization: Information Sciences Institute, Univ. of So. California Lines: 30 In article <19183@mimsy.UUCP> preetham@chisti.umiacs.umd.edu (Preetham Gopalaswamy) writes: >I am running HP-UX 6.5 on an HP Series 300 machine. I would like to convert >some grey scale pictures (running under X windows) into dithered patterns i.e. >x black dots out of n dots represents (x/n)% grey. I need this to display >black-white-grey images on a monochrome screen. Are there any standard >programs to do this or has any kind soul in netland already written it out for >me to use :-) The imglib library functions available by anonymous FTP from venera.isi.edu include a routine that uses Floyd-Steinberg dithering to translate a color image to a monochrome image. It should be possible to adapt this routine easily or perhaps to use the imglib software as is. Look at function color_to_mono in file imgcvt.c. If your original data is purely grayscale you can eliminate the color-to-grayscale translation for each pixel that precedes dithering and error propagation. To get the imglib software, do an anonymous FTP login to venera.isi.edu and pick up pub/img.tar.Z. To find images using the Img file format, check pub/img_ls-RAlF.Z and images/README. README offers some tips for dealing with the fact that anonymous ftp refuses to show directory listings for the ~ftp/images hierarchy with the "dir" or "ls" commands. ---------------- Paul Raveling Raveling@isi.edu