def ssd (im1, im2):
    """
    Return the sum-squared difference between two images.

    Arguments:
    im1  image form which im2 is to be subtracted
    im2  image to be subtracted from im1
    """
    return ((im1 - im2)**2).sum()