Added color sorting for palette images by euclidean distance