<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def tweak_diff(diff, opacity):
 """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. """

    mask = diff.point(lambda i: opacity + i * (255 - opacity) // 255)
    return mask