View Full Version : Fractional/odd resolution
tormento
6th October 2024, 10:41
I have done extensive search about fractional resolutions but it came out that is more a VS thing than an AVS+ one (and I don't want to deal with VS).
Let's say that I have found that an anime has a vertical native resolution of 843.7p. What is the proper way to deal with it, if I want to rescale the native one with some proper filter chain?
LightArrowsEXE
7th October 2024, 03:57
You can refer to the code here (https://github.com/Jaded-Encoding-Thaumaturgy/vs-scale/blob/50693af3f2d7376b2352abd834cc54f44054c5a7/vsscale/helpers.py#L321-L355) and reimplement that along with all the other logic that makes use of those kwargs, but I have to ask why you're not just doing this in VS where the tooling for this already exists, when as far as I'm aware nothing of the sort has been implemented on the AVS side yet.
Also as an aside, 843.7p makes me suspect it's 1500x843.75, which would be a 1500x844 upscale that is subpixel cropped to achieve true 16/9.
tormento
7th October 2024, 11:00
I have to ask why you're not just doing this in VS where the tooling for this already exists
The only reason is that the VS community is not as friendly as the AVS one. I tried many times to have support but I have always been treated with haughtiness and conceit, when not simply ignored.
Thanks for your ideas but I am not a programmer to be able to write my own plugin or avsi.
_Al_
8th October 2024, 03:55
Also, pointing to LightArrowsEXE, you scripts might be really useful, and although knowing python to use it with vapoursynth, your code is within a package, lots of cross-referencing modules and functions, it uses annotations to the point of code being unreadable for a regular python coder. Python with annotations messes up readability, it becomes something else, if every variable/argument object is annotated. It is not a python it used to be, :-), it is literally a scarecrow for a avisynth lurker (or even vapoursynth user). So it would be really helpful to have actually real examples how to use your modules and such, the more descriptive, the better. Stress on examples. More examples, more folks will use it. Not being pushy here, you can do whatever you want , :-) just saying. This is exactly the moment why many shy away from vapoursynth.
LightArrowsEXE
8th October 2024, 06:00
Also, pointing to LightArrowsEXE, you scripts might be really useful, and although knowing python to use it with vapoursynth, your code is within a package, lots of cross-referencing modules and functions, it uses annotations to the point of code being unreadable for a regular python coder. Python with annotations messes up readability, it becomes something else, if every variable/argument object is annotated. It is not a python it used to be, :-), it is literally a scarecrow for a avisynth lurker (or even vapoursynth user). So it would be really helpful to have actually real examples how to use your modules and such, the more descriptive, the better. Stress on examples. More examples, more folks will use it. Not being pushy here, you can do whatever you want , :-) just saying. This is exactly the moment why many shy away from vapoursynth.
Docs are already in the works now that I'm actually in control of the org (I wasn't, even though you seem to think I was? A lot of that code, let alone the whole infrastructure, also isn't designed by me...), and there's also already a guide in the works here (https://jaded-encoding-thaumaturgy.github.io/JET-guide/master/). Suggestions are welcome, but I don't think that's best done over passive-aggressive off-topic forum posts. We have repos and a discord if you want to discuss this kinda stuff better.
DTL
8th October 2024, 19:49
It is much much better to live in integer domain in both Image size and Frame size. I think no one can see difference and aspect ratio error between 843.7 and integer 844 size. But if you still want to make non-integer scaling -
1. Select at least closest int_trunc(S)+1 integer (rounding to largest integer) output size (Sout, = 844 in yor case)
2. Upscale to N.
3. Add border to the source (eh - additional border size at N-sized is (Sout - image size)* N ?).
4. Downscale to Sout (integer) so that (src_size)*(N/Sout) is your required output size of image with real scale ratio.
I not very good in math - if you post the source size I can try to make better calculation of N value. Also source image size equal to frame size (zero padding) ? If some padding is present (non-integer source image size or image is any way lower in size) - you need to know this value for better precision.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.