color_extracterΒΆ
Functionality Extracts the dominant color palette from an image and visualizes it.
Input - Path setup: Provide the image file path (image_path).
Example:
image_path = './path/to/image.jpg'
Optional parameters: - n_colors: Number of dominant colors to extract (default is 5).
Output - Return value:
extract_color_palette: Returns a list of RGB tuples for the extracted colors. Example:
[(255, 0, 0), (0, 255, 0), (0, 0, 255)]
Visualization: - plot_palette: Displays the extracted colors as a horizontal bar chart using Matplotlib.