Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4099296
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T20:24:56+00:00 2026-05-20T20:24:56+00:00

I have a ndarray with floats in it I want to save. I would

  • 0

I have a ndarray with floats in it I want to save. I would like to keep the values as float though. The only format I found that accepts saving float data is tiff. Doesn’t show the actual image however.

from Image import *
from numpy import *

img = random.random((300, 300)) #float numbers, i have actual data in my image though
img = fromarray(img)
img.save('test.tiff')
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T20:24:56+00:00Added an answer on May 20, 2026 at 8:24 pm

    Your example is saving a floating-point TIFF file. I’ve confirmed by examining the TIFF header, noting that the samples per pixel tag 0x153 has a value of 3 (floating point data). Using your example:

    import Image
    from numpy import *
    
    data = random.random((2, 2))
    img1 = Image.fromarray(data)
    img1.save('test.tiff')
    img2 = Image.open('test.tiff')
    
    f1 = list(img1.getdata())
    f2 = list(img2.getdata())
    print f1 == f2
    print f1
    

    Output:

    True
    [0.27724304795265198, 0.12728925049304962, 0.4138914942741394, 0.57919681072235107]
    

    Details on the TIFF6 file format

    Updated: Example 64×64 image viewed on Mac desktop:
    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a float pointer array and I would like to convert it to
I have an NSArray that looks like this: ArrayItem *thisone = [[ArrayItem alloc] initWithName:@The
I have an NSArray and I'd like to create a new NSArray with objects
I have 3d-data representing the atmosphere. Now I want to interpolate this data to
I have a problem with my code. I want to create a XML file
I have developed the application in which i want to set the background color
I have a custom object that simply inherits from NSObject. It has 3 members
I have an NSArray of objects that all subclass with their different types from
Hi I have an NSArray containing many 'multimedia action' as I like to call
I have a project that adds elements to an AutoCad drawing. I noticed that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.