user288609
user288609

Reputation: 13025

how to open image as rgb file when using imageio

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.

Upvotes: 5

Views: 13697

Answers (2)

user6032266
user6032266

Reputation:

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

Upvotes: 0

Hirabayashi Taro
Hirabayashi Taro

Reputation: 943

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")

Upvotes: 15

Related Questions