Thread: Avisynth+
View Single Post
Old 28th August 2019, 23:09   #4857  |  Link
ajp_anton
Registered User
 
ajp_anton's Avatar
 
Join Date: Aug 2006
Location: Stockholm/Helsinki
Posts: 805
Bug?

I don't know if this is supposed to be "expected behavior", but at least I didn't expect anything like this.

When a resizer is fed cropping coordinates from outside of the picure, what exactly is supposed to happen? I expected it to simply repeat the last line of the image, but that doesn't seem to be the case.

Code:
function blackborder(clip c,int pix)
{
  return c.crop(0,pix,0,-pix).addborders(0,pix,0,pix)
}

blankclip(width=100, height=100, length=20, pixel_type="y8", color=$ffffff)

animate(0,19,"blackborder", 0, 19)

lanczos4resize(width,height, 0, -height/2, width, height*2)
histogram
This creates a white image, but with a black border the same size as the framenumber. It then "zooms out", but keeps the overall dimensions the same, by taking a larger area around the frame and resizing it to the original size.

On frame 0, the expected behavior happens, where it just repeats the white border indefinitely and the zoomed-out image is also 100% white. On frame 1 and onwards, I was expecting it to treat the outside world as being black, however that's not what happens.

Depending on how thick the black border is and what resizer is used, the outside color oscillates around gray/black, mimicking the wave-like nature and the sampling area of the resizer. For complete blackness, a 6 pixel border is needed for spline36, 2 for bilinear, etc.

Last edited by ajp_anton; 28th August 2019 at 23:11.
ajp_anton is offline