Open rail01 opened 2 years ago
AVIF has a very low resolution limit - 8193x4320, as it's made for video. It can be rendered in tiles, but not perfect in that. JPEG-XL, on the other hand, is better in every way. It support resolution up to 1x1 Gp. It's still a little less than 2x2 Gp of PNG and 4x4 Gp of JPEG2000, but still quite a lot. So would make possible to use scale by 16 and 32. It also does lossless encoding better than PNG and WebP. Google is trying to sabotage it though, but hopefully it will make its way.
You don't need AVIF support, you can do it now! I did a mini (simple) shell script that uses imagemagick
to convert from any supported format (100+) to AVIF, and you can use it or customizing to your liking (change output format, fine tune parameters), or make it better.
#!/bin/bash
# needs installed: waifu2x-ncnn-vulkan, imagemagick
file1="${1%.*}"
mkdir -p "/tmp/waifu/"
png_in="/tmp/waifu/in.png"
png_out="/tmp/waifu/out.png"
convert "$1" "$png_in"
waifu2x-ncnn-vulkan -i "$png_in" -o "$png_out" -s 2
convert "$png_out" "$file1".avif
rm -rf "/tmp/waifu/"
waifu2x_to_avif
for this):
$ ./waifu2x_to_avif image2upscale.jpg
[0 AMD Radeon RX 580 Series] queueC=1[4] queueG=0[1] queueT=2[2]
[0 AMD Radeon RX 580 Series] bugsbn1=0 bugbilz=0 bugcopc=0 bugihfa=0
[0 AMD Radeon RX 580 Series] fp16-p/s/a=1/1/0 int8-p/s/a=1/1/1
[0 AMD Radeon RX 580 Series] subgroup=64 basic/vote/ballot/shuffle=1/1/1/1
[0 AMD Radeon RX 580 Series] fp16-matrix-16_8_8/16_8_16/16_16_16=0/0/0
I'm currently in the process of learning how to write a simple GUI using Python Eel and I tried to "implement" AVIF support by processing the image into PNG first using waifu2x and then just do a second processing using avifenc
PNG is too large and too slow to read and write
Currently, attempt to upscale image from AVIF fails with error message:
While I do have
libavif
installed in my system.Upscaling into AVIF also doesn't work with a different error:
AVIF uses AV1 codec for compression and achieves excellent results at it. It is open-source and royalty-free. It would be great if waifu2x supported it natively.