def tweak_diff(diff, opacity):
mask = diff.point(lambda i: opacity + i * (<NUM_LIT:255> - opacity) // <NUM_LIT:255>)<EOL>return mask<EOL>
Adjust a difference map into an opacity mask for a given lowest opacity.

    Performs a linear map from [0; 255] to [opacity; 255].

    The result is that similar areas will have a given opacity, while
    dissimilar areas will be opaque.