The PIL image is of 256x256 size, but as I printed out the image object it said that it has an image mode RGBA. I guess this could be  the problem. I still don’t understand why imsave() does not save it as grayscale with a single channel. I also tried PIL’s fromarray() function to save to image format, but my arrays contain float values (some of the very small values, therefore a direct conversion to int values results in zeros for the whole array) and fromarray expects uint8. Is there any way to save as an image a float valued numpy array ? Many thanks. You are very kind to answer all these questions.