Which frame receives the weight in a fixed crossfade?

blend linearly interpolates corresponding samples with alpha as the weight of the second image.

Pixel experiment and interpretation

A quarter of the way from gray 20 to 100 gives 40. The weight applies everywhere; a local occlusion needs a spatial mask.

from PIL import Image

def row(values):
    return Image.frombytes('L', (len(values), 1), bytes(values))

Image.blend(row([20]),row([100]),0.25).getpixel((0,0))

Result 40

中文

两帧图像做固定权重叠加时,权重属于哪一帧?

blend 在对应位置作线性插值,alpha 是第二张图的权重。

像素实验与适用边界

从灰度 20 过渡到 100 时,四分之一处得到 40。这是全图统一的过渡;局部遮挡需要空间变化的掩膜。

from PIL import Image

def row(values):
    return Image.frombytes('L', (len(values), 1), bytes(values))

Image.blend(row([20]),row([100]),0.25).getpixel((0,0))

结果 40

References / 参考来源

Keep reading / 继续阅读