degrain gradientmask = mt_luts(degrain,degrain,mode="range",pixels=mt_square(8),expr="y",u=1,v=1).mt_lut(expr="255 x 1 "+string(0.8)+" / * 2 ^ /",u=1,v=1).removegrain(19,-1) edge1=mt_edge(mode="prewitt", thY1=3, thY2=3) edge2=mt_edge (mode="min/max", thY1=1, thY2=1) logic1=mt_logic(edge1, edge2, "and") logic2=mt_logic(logic1, gradientmask, "andn") unfiltered Dither_convert_8_to_16 () ref=last Dither_bilateral16(thr=3) Dither_limit_dif16(last, ref, thr=0.4) DitherPost ()