Jun-07-2018, 01:55 AM
You can use numpy to do such comparison, e.g.
import numpy as np img_a_array = np.array(img_a_pixels) img_b_array = np.array(img_b_pixels) difference = (img_a_array == img_b_array).sum()Also, you can use the threshold to specify colors similarity, e.g.
threshold = 2 difference_with_threshold = (np.abs(img_a_array - img_b_array) <= threshold).sum()