5

I have an existing code segment reading image using scipy.misc

imref = misc.imread(self.file_image, False, "RGB")

If I would like to replace it with imageio, how to do that, can I just use

imref = imageio.imread(self.file_image, False). 

I am not clear where to setup the "RGB" parameter while using imageio.imread.

user288609
  • 12,465
  • 26
  • 85
  • 127

2 Answers2

15

As explained in the docs you can use the keyword argument pilmode to specify the modality, while scipy flatten is replaced by as_gray. So in your case:

imref = imageio.imread(self.file_image, as_gray=False, pilmode="RGB")
Hirabayashi Taro
  • 933
  • 9
  • 17
0

What if you get the error: "Imageio Pillow plugin requires Pillow lib"?