Алгоритм / Код для определения цвета на картинке

582
Charlie

Возможно ли иметь код, который может автоматически определять цвета на картинке? Если да, то что это за технология?

Спасибо,

0
Что значит «определять цвета»? gronostaj 10 лет назад 0

1 ответ на вопрос

1
Paulo Almeida

Yes, this can be done. For simple uses, a simple python program is sufficient. Using the imaging library:

from PIL import Image im = Image.open("image.png") data = im.getdata() 

You can now access color data for each pixel of the image in the data variable. For more complex needs, there is a lot more that can be done. For example, see a blog post on finding dominant colors in images.

Это похоже на то, что я ищу, большое спасибо! Charlie 10 лет назад 0

Похожие вопросы