A descale
wrapper for anime destriping.
- VapourSynth version R46 or newer
- vapoursynth-descale
- VapourSynth R49 and Descale R3 or newer for
Spline64
support. A recent version since this commit for using cropping parameterssrc_width
andsrc_height
. - An optional filter fixing borders before descaling. It should work for
GRAY16
input withtop
andbottom
options. It is called only if nontrivial border widths are provided. The default is EdgeFixer.
Some striped (aka cross-conversion, or 縞縞) anime artifacts are caused by improper upscaling by field. Destripe
manually descales by field.
The first plane of the input clip will be internally converted to GRAY16
if fixing borders is requested, then GRAYS
, and be processed. The output has the same format as the first plane of the input.
from destripe import Destripe
down = Destripe(clip clip[, int width=1280, int height=360, str kernel='bicubic', float b=0, float c=1/2, int taps=3, float[] src_left=[0, 0], float[] src_top=[0, 0], float[] src_width=[width, width], float[] src_height=[height, height], func fix_border_func=vs.core.edgefixer.Continuity, int[] fix_top=[0, 0], int[] fix_bottom=[0, 0], bool showdiff=False])
down, diff = Destripe(clip, ..., showdiff=True)
Parameters:
width
,height
The destination descaled size for each field. For example, if you believe the native resolution was 1280x720, then each field should be 1280x360.kernel
,b
,c
,taps
Parameters of the resizers. See Descale's page.src_left
,src_top
,src_width
,src_height
Specify the cropping parameters for the top field and the bottom field, respectively. They refer to the initial upscale, see this link. Usually you need to modifysrc_top
until satisfactory. Note thatDescale
only accepts positive values ofsrc_width
andsrc_height
, so negative or zero inputs will be replaced by values ofwidth
andheight
, respectively.fix_border_func
,fix_top
,fix_bottom
If specified, a border fixing filter will be applied to the top and bottom borders for each field, respectively, before descaling.showdiff
Set toTrue
to include the de-rescale absolute errordiff
in the return list.diff
has the same format as the first plane ofclip
.
Notes:
- IVTC should be taken prior to destriping, since this script doesn't deal with field order.
- Bad borders could be amplified while descaling.
Tweaking
fix_top
andfix_bottom
may and may not be better than fixing edges before callingDestripe
. - Resizer settings could cause a position shift of the output from the source and you are supposed to fix by yourself.
In these examples clip
already has its borders fixed before processing.
down = Destripe(clip, 1280, 360, kernel='spline64', src_top=[1/6, 1/6])
up = core.resize.Spline64(down, 1920, 1080, src_top=1/3)
See the comparison.
down = Destripe(clip, 1280, 360, kernel='bicubic', b=0, c=1/3, src_top=[1/12, -1/12])
up = core.resize.Bicubic(down, 1920, 1080, filter_param_a=0, filter_param_b=1/3)
See the comparison.
- 縞縞対策 from anibin's blog
- CullResize, anibin's AVS Destripe
- CullResize, DJATOM's 64-bit port
joletb, NiTr0gLiTcH, xyx98
MIT.