pyaesthetics.colordetection.get_colors_w3c¶
- pyaesthetics.colordetection.get_colors_w3c(img, ncolors=16, plot=False, plotncolors=5)¶
This function is used to get a simplified color palette (W3C colors). It can be used with 16 (https://www.html-color-names.com/basic-color-names.php) or 140 colors (https://www.w3schools.com/colors/colors_names.asp).
- Parameters:
img (numpy.ndarray) – Image to analyze in RGB format.
ncolors (int) – Number of colors to use (e.g., 16 or 140). Default is 16.
plot (bool) – Whether to plot a color palette image showing the top colors.
plotncolors (int) – Number of colors to display in the palette image. Default is 5.
clusterfactor (int) – Factor to cluster similar colors. Default is 50.
- Returns:
An array of RGB values representing the most frequent colors.
- Return type:
numpy.ndarray