On 10/30/06, Mike Hord wrote: > I have raw image data, stripped from an isochronous FireWire > stream, that I'd like to view. > > Has anyone had any experience with making this happen? The > data is 8-bit grayscale- it should be amazingly easy to do this, > but it's turning out harder than I'd have suspected. > > Note that there isn't any file header data or anything- it's from a > 1024x768 pixel detector, and I have exactly 512 packets of 8-bit > data, 1536 bytes per packet. AIUI, it doesn't even match the > .raw image format. > > I'd hate to have to write a program to do this. > > Mike H. Here's what I'd do: 1) Use a raster editor (the Gimp) to make a 1024*768 greyscale image. 2) Save the image as a MS-bitmap (.bmp) file, no compression. 3) The image is a little bigger than the pixel count: [markrages@midwesttelecine ~]$ echo $(( 1024*768 )) 786432 [markrages@midwesttelecine ~]$ ls -l test.bmp -rw-rw-r-- 1 markrages markrages 787510 Oct 30 13:22 test.bmp This is because the bmp format tacks a header on the front. We will reuse this header with the image information. 4) Assuming your packets are numbered packet001...packet512, assemble the image like this: ( head -c $(( 787510 - 1024*768 )) test.bmp && cat packet??? ) > out.bmp This is for a Unixy system like Linux or MacOS. For Windows, consult your shell documentation, but the idea should hold. Regards. Mark markrages@gmail -- You think that it is a secret, but it never has been one. - fortune cookie -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist