Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 623
user288609 Avatar asked Apr 06 '18 22:04

user288609


1 Answers

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")
like image 61
Hirabayashi Taro Avatar answered Sep 28 '22 03:09

Hirabayashi Taro