OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Create a multiframe .tif file

  • Thread starter Thread starter Marmstrong
  • Start date Start date
M

Marmstrong

Guest
I have pixel data that I want to use to create a new .tif image that has multiple frames. How would I go about doing this? I have tried python PIL however I have only found it supports multiple frame reading not writing. See below for my attempt that didn't work.

Code:
new_Image = Image.new("I;16", (num_pixels,num_rows))

for frame in range((len(final_rows)/num_rows)):
    pixels = new_Image.load()
    for row in range(num_rows):
        row_pixel = final_rows[row].getPixels()
        for pixel in range(num_pixels):
            pixels[pixel,row] = row_pixel[pixel]
    print frame
    new_Image.seek(frame)
<p>I have pixel data that I want to use to create a new <code>.tif</code> image that has multiple frames. How would I go about doing this? I have tried python PIL however I have only found it supports multiple frame reading not writing. See below for my attempt that didn't work.</p>

<pre><code>new_Image = Image.new("I;16", (num_pixels,num_rows))

for frame in range((len(final_rows)/num_rows)):
pixels = new_Image.load()
for row in range(num_rows):
row_pixel = final_rows[row].getPixels()
for pixel in range(num_pixels):
pixels[pixel,row] = row_pixel[pixel]
print frame
new_Image.seek(frame)
</code></pre>
 
Top