Extracting dominant color palette from an image