bloc97 / anime4k Goto Github PK
View Code? Open in Web Editor NEWA High-Quality Real Time Upscaler for Anime Video
Home Page: https://bloc97.github.io/Anime4K/
License: MIT License
A High-Quality Real Time Upscaler for Anime Video
Home Page: https://bloc97.github.io/Anime4K/
License: MIT License
Please support android
Describe the bug
Burned-In Text on Video looks weird when compared with other upscaler.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Good Readable Text.
Screenshots
https://imgur.com/a/XrHuHKV
This just came to mind... can this be ported to be used as a premier pro or vegas plug in?
or heck openshot or shotcut video plugins if you dont want to deal with pay programs.
I think it would be really useful to be able to edit video with anime4k up scaling on the fly. at least i would find it very useful.
I followed the installation instructions and when using the MPV profiler i can see that the shaders are running
However in fullscreen mode the video is completely black and i can only hear the audio track
i tried various files and none of them are working
Ialso tried to change the mpv.conf settings however i was not able to find a solution to the problem
4K display is too big,not suitable for PC
2K is a more good and useful.
Does anime4K can change 1080P to 1440P?
Hi, It is a really wonderful project!!
Following the tutorial, I tried to run Anime4k on MHC-HC and MPV, but they all failed to transfer the video. There was no difference after running the algorithm, and I did not get any error or warning. Could you give me some advice for any possible reason?
Environment: MHC-HC on Win10 & MPV on Ubuntu 18.04
Version: All latest
Thanks a lot
Hi, I have been using your algorithm on top of NGU for the past 3 months or so.
I have noticed that the hlsl version has not been updated in quite a while.
I tried to convert the glsl shader to hlsl using glslang and SPIRV-Cross but I failed.
I would like to know if you are going to update the hlsl version in the future or if there is an easier way to convert the glsl shader.
I just made the Rust lang implementation. You might want to check it
Can I make a pull request to add it under "Projects that use Anime4K" on README.md
?
To be honest lots of people watch anime online these days, if these's a anime4K extensions on chrome to support any anime website will be nice..
Please take a look at these algorithm repos:
Is it possible to do testing will most of them and analyse the differences?
Improve line detection speed as it does not need to be pixel precise. The underlying line refinement and FXAA algorithms are already robust enough. False positives are less harmful than false negatives. (eg. use smaller gaussian kernel, or even use lower luma resolution)
Use line detection to skip processing some parts of the picture all together when the probability of finding a line is lower than some threshold. (eg. 10% when refining and applying FXAA)
Combine similar passes into a single pass if possible. This will reduce the time needed to copy textures between separate passes. On 4K+ resolutions image processing is often memory-bound and not compute-bound.
The target should be 4-5ms.
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
Hi,
Noob here so please avoid my ignorance. I am not well versed with the field but would like to convert &/or view Anime. Even to 1080p of old once from 480p will be awesome!
I own a 2017 macPro with Raedon 560.
Thanks!
I've been googling around but haven't been able to find anything useful about running the shader on a video file and saving the output.
Is your feature request related to a problem? Please describe.
A way to encode the video to be later viewed on something like Plex.
Describe the solution you'd like
A way to encode the video into a 4k resolution video file to be viewed later or on other players.
Describe alternatives you've considered
A have used it and it works great but only works in players that I don't normally or can't use sometimes.
Additional context
A script or even some workaround like using a video player, that currently works with the plugin, to encode and save the video file. I know you can do some encoding with VLC.
Describe the bug
I followed this Instructions: https://github.com/bloc97/Anime4K/blob/master/GLSL_Instructions.md
But when i run mpv
in the command line, this error is thrown:
Error parsing option glsl-shaders (option not found) ... setting option glsl-shaders='~~/shaders/Anime4K_Adaptive.glsl' failed.
Desktop (please complete the following information):
Exception in thread "main" java.lang.NoClassDefFoundError: com/aparapi/Kernel
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:151)
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:802)
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:700)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:623)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at com.bloc97.anime4k.Main.(Main.java:24)
Caused by: java.lang.ClassNotFoundException: com.aparapi.Kernel
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 10 more
Why describe this algorithm an as upscaling algorithm and not a sharpening algorithm? From what I understand it doesn't have anything to do with the actual scaling process and relies on conventional scaling algorithms.
Describe the bug
I passed this over my hentai and it didn't made me nut faster, what the fuck!
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A big nut in less than the previous best time
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context
inconceivable!
SMPlayer is a GUI of Mplayer and mpv, I can add option of mpv in advanced preference, but has no effect with Anime4K. Is there any one know how to use?
When using the version 2.0RC2 version of the shader, the final pass (Anime4K-Hybrid-Refine-v2.0RC2) is run on unscaled or downscaled video.
I would expect nothing at all to be run in these situations.
Tested on Windows 10 20H1 with v.2.0RC2 and mpv version 0.31 and 0.32.
(On a side note, the shader seems to work perfectly well with mpv 0.32 using the Vulkan and OpenGL backends-- it seems only the D3D11 backend is affected.)
Hi,
I have switched over to MPV from my older madvr setup in order to use the latest version of Anime4k.
It's working fine for most anime but I came across this severe case of aliasing today:
Magia Record - Mahou Shoujo Madoka Magica Gaiden - 04 / 07:31
Same scene with Madvr ngu standard:
I was wondering if there is something wrong with the way I set up mpv, I am going to attach the configuration file.
mpv.zip
Clip: http://www.mediafire.com/file/xbz14aq5t5u9pu7/a.mkv/file
I tested it out and it seems to be using the gpu as intended.
However, I am not sure if it occurs that in times the entire frame looks like it was upscaled bilinearly, while at other times it feels like the image is significantly improved. I have tested it by moving back and forth between the video and on video formats smaller than 480p and it seems to be working, but not much effect had applied to those videos since they have a small resolution
Non-parseable POM C:\Users\73765\Desktop\123\pom.xml: Expected root element 'project' but found 'html' (position: START_TAG seen ...\n... @8:17) @ line 8, column 17 -> [Help 2]
chrome cannot run with error on console
Uncaught DOMException: Failed to execute 'texImage2D' on 'WebGLRenderingContext': The image element contains cross-origin data, and may not be loaded. at createTexture (file:///E:/Download/Anime4K-master/Anime4K-master/web/main.js:56:12) at Scaler.inputImage (file:///E:/Download/Anime4K-master/Anime4K-master/web/main.js:487:21) at Image.inputImg.onload (file:///E:/Download/Anime4K-master/Anime4K-master/web/main.js:693:16) createTexture @ main.js:56 Scaler.inputImage @ main.js:487 inputImg.onload @ main.js:693 load (async) onLoad @ main.js:689 onload @ index.html:11
1
https://github.com/bloc97/Anime4K/blob/master/Java_Instructions.md
how do you get the default upsampling scale first, by bicubic? or bilinear?of other methods? And then use the enhancement Anime4K method.
2
https://github.com/bloc97/Anime4K/blob/master/results/Graph.png?raw=true
how do you get the perceptual quality?
chrome cannot run with error on console
VM797 main.js:705 Uncaught TypeError: Cannot read property 'inputImage' of null
at Image.inputImg.onload (VM797 main.js:705)
inputImg.onload @ VM797 main.js:705
load (async)
changeImage @ VM797 main.js:702
reader.onload @ VM797 main.js:736
load (async)
onSelectFile @ VM797 main.js:733
onchange @ index.html:17
How does the method compare to Anisotropic diffusion or Total variation denoising? Are there similarities in the approach?
I believe Anime4K can be applied to another use case where a video signal has sharp edges and reduced color spaces: retro video games. Many retro video games were designed to have part or all of their video signal output 480i/576i, a signal that modern displays cannot natively interpret. While complex deinterlacing algorithms exist and may be suitable for full motion video, they introduce too much latency to video games to be desirable.
The current solution used by enthusiast retro gamers is to use devices like the Retro Tink 2x or the Open Source Scan Converter (OSSC) to perform an operation known as "bob deinterlacing" (so-named because of the noticeable up-and-down bobbing of stationary parts of the screen that have edges changing their height between fields). It is, intentionally, the most naive version of line-doubling, and produces usually-good-enough results with acceptably little image processing time.
The upscaling method described by Anime4k might be able to noticeably improve the visual quality of line-doubling without introducing a significant amount of signal latency by treating the 240/288 line resolution of each field as the source and the 480/576 line resolution as the target.
Prior to finding Anime4k, I also investigated alternative methods of deinterlacing. The best quality results, as with anime, were achieved with AI[0]. Unfortunately, the lowest latency achieved for SD content was between 13-14ms (nearly a full frame of delay for 60fps content), and was only possible using a workstation with an Intel i7-5930, 65GiB of RAM, and an Nvidia Titan GPU[0, pg 8]. Like with anime, real-time results will require a more direct approach. The low latency of Anime4k and the consistent edges of video game content may make Anime4k a viable alternative to bob deinterlacing.
If you decide that you are interested in possibly integrating Anime4k into realtime video game deinterlacing solutions, a good person to contact would be Markus Hiienkari (marqs on the Video Game Perfection forums), as he is the designer of the OSSC.
I was wondering if there is a programmatic python version for anime4k in the works? Maybe using something like cv2? The glsl/mpv results are super cool but it's limited to just real time upscaling on your own desktop. I think there is a use case for having this as one part of an image processing pipeline.
Hey,
I think it would be nice to have GLSL versions of this, especially since as far as I'm aware, a large portion of the more video-tweaky community often use's Linux and OpenGL based players like mpv, rather than DirectX.
and can this algorithm remove noise from image??
thank you
Does anyone help me compile the jar in linux? I'm new to python, and I still know less about java, how can I compile .jar on linux? (if possible)
Bug: When you follow the instructions to add glsl shaders, the shaders do not end up working
I discovered the solution.
profile=gpu-hq
scale=ewa_lanczossharp
cscale=ewa_lanczossharp
video-sync=display-resample
interpolation
tscale=oversample
glsl-shaders-append="%AppData%\mpv\Shaders\Anime4K_Hybrid_v2.glsl"
here is a sample config file for mpv
so the config file is called mpv.config and it is stored in %AppData%\mpv
and the shaders can be where you want, you just have to make sure to change whats in the quotes to point to the shader files
Using the build gotten from the "How to Use" page the program seems to only upscale images.
using the following commands on a given test image,
java -jar Anime4K.jar test.png out_1.png 2 0.6 0
java -jar Anime4K.jar test.png out_2.png 2 1 1
yields no visual difference between out_1.png
or out_2.png
, and running
diff out_1.png out_2.png
shows that they are the same file.
They were up scaled though.
I tried other images and numbers too, but this example I think gives a concise presentation of my problem and uses almost the same numbers that were on the download page (i had to change the scale)
Looking at the code in the Main file it seems that while actions are run with the 'kernel' variable, it never interacts with the 'img' variable before it is resaved, though I don't have much faith in my assessment of the problem's origin as I don't understand most of the code.
sorry if I've made some simple mistake, I tried to make sure that it wasn't the case but it easily could be.
Implementation in wasm or webgl shader that worked with video tag / canvas would be very interesting and would let foulks pop this into web anime players as an option. Would the runtime be fast enough for real-time in web context ?
How can i use it on bilibili?
hello it is could use for real movie ?
Seems like it requires OpenCL, but is it possible to run it in docker containers for easier deployment on servers or cross-platform development?
Due to how MPC handles shaders, they are always applied after subtitles. I am not sure if it is changeable.
For MPV, the user can choose to not apply shaders on subtitles.
Currently when looking at stats in mpv this shader has no proper name
shows:
user shader:(unknown)
By adding //!DESC Anime4K
shows:
user shader:Anime4k
Needs to be added to each set
//!HOOK SCALED
//!BIND HOOKED
//!BIND POSTKERNEL
//!SAVE POSTKERNEL
Hello,
this is a bit of a noob question but does those shaders work with mpc-hc?
From what i understand of the install process in mpc-be one only has to add the shaders and add them to the post-resize.
However after doing this in mpc-hc i don't see any difference :D
Wondering if there is something special to do or if they simply do not work out of the box with this player.
Any help would be appreciated, have a good day guys.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.