Added two palette extraction method, precise and average.