Improve the color sampling method for makeing adaptive palette