Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site gumby.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!whuxl!whuxlm!akgua!gatech!seismo!uwvax!gumby!adams1 From: adams1@gumby.UUCP Newsgroups: net.micro.mac Subject: Re: Thunderscan grey map image and other questions. Message-ID: <30@gumby.UUCP> Date: Thu, 12-Dec-85 08:32:13 EST Article-I.D.: gumby.30 Posted: Thu Dec 12 08:32:13 1985 Date-Received: Sun, 15-Dec-85 06:50:32 EST References: <914@mcvax.UUCP> Organization: U of Wisconsin CS Dept Lines: 61 > A colleague of mine (Marjo) is trying to understand the file > format of a Thunderscan file. She wants to write a program to ... > Therefore she wants to know (and I as well) how to interpret > the scanned-image-file. > > 1) Offset 2: bounding rectangle (8 bytes); The bounding rectangle is relative to the image scanned. I think it is in this order: top, left, bottom, right. The top and left are usually zero. > 2) Offset 12: resolution Tells whether this is a bitmap or grey may info, that's all. > 3) This is about the grey map and I quote: > "The gray map consists of scan lines packed with 4 bits per > pixel, 2 per byte, followed by remainder bytes (the fifth bit), > 8 per pixel." > We know that there are 5 bits per pixel specifying the gray values. > We understand that this information is grouped: two pixels in > one byte, but what we don't understand is where EXACTLY are > those fifth bits. > And what is meant with: "8 per pixel". Is that 8 bits per pixel, > or 8 bytes (the latter is suggested). If it are 8 bits per pixel > does that mean that there are three bytes for two pixels? > The first byte split in two, followed by one byte for pixel_1 > and one byte for pixel_2? > > Marjo & Frank > Marjo Rottschaefer ___ > Frank Kuiper, CWI, Amsterdam. _][__| | > ...{decvax,philabs,seismo,okstate,garfield}!mcvax!frankk <_______|-1 > Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch. O-O-O > -- Well, the grey stuff IS a little complicated. Lets see... Each pixels has 5 bits associated with it. So, we take four of those five (I don't recall if they are the most-significant or least significant) and pack them two by two in bytes for one scan line. Then we pack together all of the left-over bits, eight per byte (Just string them together.) I've got MS-BASIC programs that read T-Scan files, and do different things to them (like smoothing [pixel averaging]). HOWEVER - I think you can save a lot of work if you get your update to T-Scan version 2.7 which just came out. It has an option where you can select an area, and select Halftone with the Option key down, and it will write a file on your disk called "HalftoneFile" which has the grey stuff (AFTER contrast & Brightness & Grey Filter adjustments). The pixels are encoded 0 to 31 starting at ASCII "0" (Through "O", I guess). You could read this file. (New T-Scan also works with switcher, so you could have your image analysis program running at the same time. This gives you the advantage of seeing the part of the picture that you will be analysing. I will be putting together some super-fantastic T-Scan support programs someday when work & school slack me some time (-=*RIGHT*=-)... Good luck. Dennis Adams !uwvax!gumby!adams1 but not very much longer... semester ends next week!