Thanks. Unfortunately, the fellow that can answer my question left early
yesterday, so I won't know exactly the file's structure until Monday.

Christopher Barker wrote:
Wayne Watson wrote:
I didn't know I could post, attach I guess, here. I'll do that later.

 as long as it's a small file -- it can be much easier to help

There is one puzzling format difficulty I have with the file that requires some attention. I hope to have that cleared up in the next hour or two. Actually, there's a twist in the format that should be mentioned. The first image (frame) is 640x480, and I'm pretty sure one byte per pixel. However, every other image (frame) after that is 128 pixels square. An auxiliary text file provides where, x and y pixel position, the small image should be pasted to form a complete image with the 640x480 frame.

Maybe it's because I"m more familiar with numpy than PIL, but this is how I'd do that (untested, of course...):

import numpy as np

infile = file('filename')

img = np.fromfile(infile, count=640*480, dtype=np.uint8)


for i in range(num_images):
    do_something
    small_image = np.fromfile(infile, count=128*128, dtype=np.uint8)
    img[x:x+128, y:y+128] = small_image
    ....

NOTE: np.histogram2d might do what you want for the histogram


I'm sure you can do somethign similar directly with PIL.

-Chris









--
          Wayne Watson (Watson Adventures, Prop., Nevada City, CA)

            (121.015 Deg. W, 39.262 Deg. N) GMT-8 hr std. time)
             Obz Site:  39° 15' 7" N, 121° 2' 32" W, 2700 feet

                  350 350 350 350 350 350 350 350 350 350
                    Make the number famous. See 350.org
           The major event has passed, but keep the number alive.

                   Web Page: <www.speckledwithstars.net/>


_______________________________________________
Image-SIG maillist  -  Image-SIG@python.org
http://mail.python.org/mailman/listinfo/image-sig

Reply via email to