gradio icon indicating copy to clipboard operation
gradio copied to clipboard

Image mode not supporting alpha channel

Open mortium91 opened this issue 4 years ago • 3 comments

We noticed for image inputs only rgb and black/white is supported and the alpha channel gets removed. You guys plan to support transparency anytime soon? We use .png's with transparency a lot!

Besides that, Gradio is awesome btw!

mortium91 avatar Mar 09 '21 16:03 mortium91

You can actually pass image_mode="RGBA". Thanks for pointing that this is missing from the documentation! We use Pillow for image processing, so any image_mode supported by PIL is supported by gradio

aliabid94 avatar Mar 10 '21 19:03 aliabid94

Hi, sorry to bother you, but this took me forever to figure out, because inputting a image with alpha channel results in a dummy picture being loaded. I searched the docs and havent found your hint regarding RGBA as image_mode. It only says ""RGB" if color, or "L" if black and white." at https://gradio.app/docs/#image

Skiddoh avatar Sep 10 '22 00:09 Skiddoh

I'll add this to the docs, you're right that should be much more clear!

aliabid94 avatar Sep 13 '22 01:09 aliabid94