2
votes

I've a transparent image (4 channels) where the 4th channel is alpha channel. I want to read the image using skimage.io.imread() method. But if I set pilmode=rgb, then the transparent part becomes black, but I want it to be white. How can I achieve this?

1

1 Answers

2
votes

You can do the following:

import skimage.color
import skimage.io

image = skimage.io.imread('res/images/image.png')
image = skimage.color.rgba2rgb(image)