Hi all,
I am reading binary data from one file that specifies intensity values across x and y coordinates (not a open-source image format) and want to convert it to a PNG image (or other widely supported format). I have the data loaded into an array (using the array module) where each element is a integer from 0 to 255. To save this to a PNG I can create a 3 item tuple of each element (x) like so:
t = (x, x, x)
add apply it across the array using the map(), then save the image using putdata(). However, the conversion to the array of tuples takes a long time (few minutes). Is there a way to specify the rgb value using only one integer (not a tuple). I guessing an alternative would be to use NumPy, but I don't know where to start, so any help in this regard would also be appreciated.
Thanks in advance for the help.