It is the ConvertToYV12(chromaresample="point") that is the issue. Cropping by one half a color sample and using point resize is supposed to shift chroma, as IanB explained, no way around it.
This seems to not shift chroma and looks better with my test than the simple
ConvertToYV12(chromaresample="lanczos"):
Code:
PointResize(last.width*2,last.height*2)
ConvertToYV12(chromaresample="point")
LanczosResize(last.width/2,last.height/2)
But I am at a loss to explain why, probably something to do with resizing the luma along with the chroma.
Better to crop in multiples of 2.
I used this test script though ffdshow (YV12->NV12) and MadVR (0.85.1, nearest neighbor):
Code:
imagesource("red.png", pixel_type = "RGB32")
PointResize(30,30)
ConvertToYV12(chromaresample="point")
addborders(2,2,2,2)
ConvertToYV24(chromaresample="point")
MergeChroma(PointResize(width, height, 0, 1))
ConvertToRGB32()
Crop(0,1,0,-1)
PointResize(last.width*2,last.height*2)
ConvertToYV12(chromaresample="point")
LanczosResize(last.width/2,last.height/2)
An aside: For the same reasons you should not be using super sampling and point resize at the same time. Using point resize undoes the super sampling. I think your example would just add 106 to the top and 98 to the bottom.