Videos
Just give the number_of_colors variable a number as big as possible. System will process it properly.
import colorgram as cg
color_list = cg.extract("dot-img.jpg", 2 ** 32)
color_palette = []
for count in range(len(color_list)):
rgb = color_list[count]
color = rgb.rgb
color_palette.append(color)
The source code in colorgram:
def get_colors(samples, used, number_of_colors):
pixels = 0
colors = []
number_of_colors = min(number_of_colors, len(used))
for count, index in used[:number_of_colors]:
pixels += count
color = Color(
samples[index] // count,
samples[index + 1] // count,
samples[index + 2] // count,
count
)
colors.append(color)
for color in colors:
color.proportion /= pixels
return colors
You can work this after answers from given users but it won't work because your format is "RGB". If you want to use that kind of color, you should convert it. For example:
import colorgram as cg
import turtle as t
colors = cg.extract('pink_image.jpg', 25)
rgb_colors = []
t.speed(100)
screen = t.Screen()
for coloring in colors:
r = coloring.rgb.r
g = coloring.rgb.g
b = coloring.rgb.b
new_color = (r, g, b)
rgb_colors.append(new_color)
print(rgb_colors)
Look output where it stays above after yours. When you look at your own code, you can see that kind of output:
>> [Rgb(r=245, g=243, b=238),Rgb(r=247, g=242, b=244)] you can't use this like that. You should convert it like my code. I hope that you understand it.
Is there a tool / method in a given drawing software of extracting all of the colours from an image, mapped onto a colour wheel?
The closest I have found is hexcolor but it produces an unordered list of colours which is hard to parse. Other sites max out at 10 or so colours extracted.
My desire is to see, on a colour wheel, what colours an artist used in a given work. Is there a better way of doing this?
I have a vague memory of seeing this kind of software mentioned for use with analyzing colour in film screencaps but may be wrong.
Thank you!
I created a web application, getcolor.codes, to extract a color palette from an image. It's free and has no ads (so far). I'm wondering how useful it is and what advice you could give me, such as what features could be added or what needs to be fixed.
Screenshot