I am using Python's colorgram library to extract color information from an image. One version of my code is as follows:
import colorgram
num_cols = 25
rgb_colors = []
colors = colorgram.extract('image.jpg', num_cols)
for color in colors:
r = color.rgb.r
g = color.rgb.g
b = color.rgb.b
new_color = (r, g, b)
rgb_colors.append(new_color)
print(rgb_colors)
print(len(rgb_colors))
The code works just fine, but if I give 'num_cols' a value of more than 36, the code only finds a maximum of 36 colors. I have tried different hi res images, and have tried different versions of the same code that I found online, but I always get this same limit of 36 colors; I just don't know where the problem can be, and I have not seen anyone else report the same issue. Can someone please tell me if I am doing something stupid here? Thanks.