A VapourSynth script for easy resizing using nnedi3/znedi3/nnedi3cl with center alignment and correct chroma placement.
It can do scaling, color space conversion, etc.
For Windows users, put nnedi3_resample.py into
- VapourSynth installed for all users:
<python folder>\Lib\site-packages
- VapourSynth installed for current user:
%AppData%\Python\Python<version>\site-packages
- Internally, nnedi3_resample always processes in 16-bit integer. The output format can be specified by
csp
with Format id (default is the same as input). - To speed up the processing, it is recommended to input 16-bit clip to avoid internal depth conversions.
- To speed up the processing, it is recommended to input YUV rather than RGB, as processing UV planes are much faster when
pscrn
>0.
Double the width and height of a clip.
Optional mode='nnedi3cl' to force using NNEDI3CL plugin.
import vapoursynth as vs
from vapoursynth import core
from nnedi3_resample import nnedi3_resample
clip = XXXSource()
clip = nnedi3_resample(clip, clip.width * 2, clip.height * 2, mode='nnedi3cl')
clip.set_output()
- Add new option
mode
, default value is None, which will automatically choose the available plugin (from top to bottom priority):znedi3
, faster CPU implementationnnedi3
, original CPU implementationnnedi3cl
, OpenCL implementation, with a new optiondevice
to specify the desired device (refer to )
- Change how to import core because
get_core
is deprecated. - Remove
YCOCG
andCOMPAT
, deprecated in VapourSynth API4.