Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!ames!bionet!agate!shelby!polya!ali From: ali@polya.Stanford.EDU (Ali T. Ozer) Newsgroups: comp.sys.next Subject: Re: How do I display a byte image ??? Message-ID: <11638@polya.Stanford.EDU> Date: 2 Sep 89 16:33:53 GMT References: <438@dftsrv.gsfc.nasa.gov> Sender: Ali T. Ozer Reply-To: aozer@NeXT.com (Ali Ozer) Organization: . Lines: 47 In article <438@dftsrv.gsfc.nasa.gov> Bob Cahalan writes: >I have a LANDSAT image of Washington DC, and I'd like >to see how it looks on the MegaPixel display. Can anyone >help me with code? The image is 1024X1024 8-bit pixels, and >the file has no header -- just 1024 bytes for line 1 followed >by 1024 bytes for line 2, etc to EOF, altogether 1 Megabyte. You can try appending a PS header on top of it and executing it in Yap. Here's a header that might work; it worked for me when I added it to the pictures of Neptune & Triton I grabbed off some FTP host. ------------------------------------------------------------------------------ %! /scaleFactor 1 def /width 640 def /height 480 def /depth 8 def /picstr width 8 idiv string def /thedata { width height depth [width 0 0 height neg 0 height] { currentfile picstr readstring pop } image } def width scaleFactor mul height scaleFactor mul scale thedata ------------------------------------------------------------------------------ Cut the section between the lines, save as "header.ps", change the width and height values (to 1024 and 1024), then append it to the front of your data file with cat header.ps yourdatafile > new.ps Then fire Yap up, and open new.ps. You need to be patient; 0.9 Yap can get pretty slow in opening large files. Once it's loaded, execute it; see what you get. I hope it works! The file new.ps won't be previewable; it lacks the correct EPSF header using the above cheapo segment of PostScript. But if it works through Yap, then we can worry about making it correct EPSF. You can also just do a screen grab with Icon or Scene to get a TIFF file. >I suppose I would only see 2-bit pixels on the MegaP-display, >or can I use the other 2 bits as well? PostScript is pretty smart about dithering; it will not waste your 8 bits. Ali Ozer, NeXT Developer Support aozer@NeXT.com