Java implementation of "PerceptualDiff"