Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
「meanColor()」が BGR の値を出力することは知っていますが、これらの値を個別に取得するにはどうすればよいですか?
例えば:
img = "picture" colors = img.meanColor() print(colors)
そして、私はこのようなものを手に入れます(30,10,40)
(30,10,40)
30が欲しいとしましょう。
別の変数に割り当てるにはどうすればよいですか?
あなたの解決策を説明してください。
ありがとう
これはタプルなので、次のようにすることができます:
blue = colors[0] green = colors[1] red = colors[2] #or b, g, r = colors