video2x icon indicating copy to clipboard operation
video2x copied to clipboard

Transparent gifs

Open IntrovertBoi opened this issue 5 years ago • 7 comments

Description

I haven't found a feature to keep transparency in gifs. When I upscale gifs, it replaces empty space with a white background, that I do not need.

IntrovertBoi avatar Feb 12 '21 19:02 IntrovertBoi

You should be able to preserve the alpha channel with the current build. If not through GUI, through the config file or CLI. Which driver you're using now?

k4yt3x avatar Feb 12 '21 23:02 k4yt3x

Waifu2x Caffe.

IntrovertBoi avatar Feb 13 '21 10:02 IntrovertBoi

I'm actually not sure if waifu2x-caffe supports alpha channels.

k4yt3x avatar Feb 14 '21 05:02 k4yt3x

Im another guy with the same problem. I have been trying to do also upsale gifs with transparency and I also end with a white background instead of a transparent one. I have been trying different drives, all of them resulting in a white background. If I try with a .png normal image, it keeps the transparency. (Im in the 4.6.1 version since the current one crash when I try to open it)

tankume avatar Feb 14 '21 10:02 tankume

@k4yt3x Well which driver supports them then?

IntrovertBoi avatar Feb 14 '21 10:02 IntrovertBoi

I remember waifu2x-ncnn-vulkan supports it? I can't find the switch for it though. Try it I guess.

k4yt3x avatar Feb 19 '21 17:02 k4yt3x

It's not a problem of drivers, you need to change your FFMPEG settings.

GIF frames are extracted by FFMPEG, which has a default pixel format value of rgb24 for frames extraction so it's scrubbing off your alpha values. You need to set another format which includes transparency such as "rgba". Run "ffmpeg -pix_fmts" for a list of accepted formats.

After a quick check, it seems all drivers except Anime4KCPP support transparency, but you might have some aliasing on the edges

Wally869 avatar Jul 29 '21 23:07 Wally869