implement rgb+xy clustering