Moebits/waifu2x

Some Questions about weird behavior(s)

Closed this issue · 3 comments

  1. I got this kind of weird rainbow line on the stair-like lines, and is there any way to handle this?
  • source
    1

  • 5.12x upscaled

1-5 12x2

  1. GIF upscaling got really weird behavior (some frame could not handle transparency, and some frame lost lot's of pixels):

2-1 -> some frame could not handle transparency

  • source
    1

  • 5.12 upscaled
    1-5 12x2

2-2-> some frame lost lot's of pixels

  • source
    5

  • 5.12x upscaled
    5-5 12x2

a) This is an artifact of the waifu2x algorithm, nothing I can do about it.

b) I have updated it to replace transparency with transparentColor, so if you set it to #000000 for example then black will be the transparent color, avoiding that problem.

Overall I have found that the GIFEncoder does a poor job when encoding transparent gifs, I will see if I can find a better gif encoder.

c) This is caused by setting cumulative to false in the gif options (or not specifying it). Some gifs only store partial frame data per frame, so setting cumulative to true fixes this issue by layering it with previous frames. I have made it true by default in the latest version.

I recommend converting your transparent gifs to animated webp because the webp encoder is much better. The function is waifu2x.upscaleAnimatedWebp(), with same parameters as upscaleGIF() function.

Gotcha. I'll try it and give you result after testing it.

Thanks for your service :)

@Tenpi Alright. I've tried lots of ways but the best thing was converting gif to webp and upscaling. IT DO WORKS LIKE CHARM :D and it actually solved all the other problems. Thanks!