[Python] Convert RGB color to English color name, like 'green' with Python

Discussão em 'Python' iniciado por Stack, Janeiro 31, 2025.

  1. Stack

    Stack Membro Participativo

    I want to convert a color tuple to a color name, like 'yellow' or 'blue'

    >>> im = Image.open("test.jpg")
    >>> n, color = max(im.getcolors(im.size[0]*im.size[1]))
    >>> print color
    (119, 172, 152)


    Is there a simple way in python to do this?

    Continue reading...

Compartilhe esta Página