Combine 3 separate numpy arrays to an RGB image in Python

前端 未结 5 734
遥遥无期
遥遥无期 2020-12-02 10:19

So I have a set of data which I am able to convert to form separate numpy arrays of R, G, B bands. Now I need to combine them to form an RGB image.

I tried \'Image\

5条回答
  •  无人及你
    2020-12-02 10:51

    Convert the numpy arrays to uint8 before passing them to Image.fromarray

    Eg. if you have floats in the range [0..1]:

    r = Image.fromarray(numpy.uint8(r_array*255.999))
    

提交回复
热议问题