|
|
|
@ -3,25 +3,56 @@ from PIL import Image
|
|
|
|
|
|
|
|
|
|
COLORS = {
|
|
|
|
|
(255, 255, 255): 'white',
|
|
|
|
|
(0, 0, 255): 'blue',
|
|
|
|
|
(255, 0, 0): 'red',
|
|
|
|
|
(0, 255, 0): 'lime',
|
|
|
|
|
(0, 0, 0): 'black',
|
|
|
|
|
|
|
|
|
|
(255, 0, 0): 'light_red',
|
|
|
|
|
(192, 0, 0): 'red',
|
|
|
|
|
(128, 0, 0): 'dark_red',
|
|
|
|
|
|
|
|
|
|
(80, 25, 40): 'maroon',
|
|
|
|
|
(25, 5, 5): 'dark_maroon',
|
|
|
|
|
(115, 40, 60): 'light_maroon',
|
|
|
|
|
|
|
|
|
|
(165, 90, 25): 'brown',
|
|
|
|
|
(210, 150, 95): 'light_brown',
|
|
|
|
|
(50, 40, 10): 'dark_brown',
|
|
|
|
|
|
|
|
|
|
(250, 245, 200): 'sand',
|
|
|
|
|
(255, 128, 0): 'orange',
|
|
|
|
|
|
|
|
|
|
(255, 255, 0): 'yellow',
|
|
|
|
|
(0, 255, 255): 'cyan',
|
|
|
|
|
(128, 0, 255): 'purple',
|
|
|
|
|
(255, 0, 255): 'pink',
|
|
|
|
|
(255, 215, 0): 'light_gold',
|
|
|
|
|
(185, 135, 10): 'dark_gold',
|
|
|
|
|
(220, 165, 30): 'gold',
|
|
|
|
|
|
|
|
|
|
(0, 255, 0): 'light_lime',
|
|
|
|
|
(0, 128, 0): 'lime',
|
|
|
|
|
(128, 255, 0): 'salad',
|
|
|
|
|
(0, 255, 128): 'mint',
|
|
|
|
|
(0, 128, 0): 'green',
|
|
|
|
|
|
|
|
|
|
(0, 255, 255): 'cyan',
|
|
|
|
|
(0, 128, 255): 'light_blue',
|
|
|
|
|
(0, 0, 255): 'blue',
|
|
|
|
|
(0, 65, 90): 'dark_blue',
|
|
|
|
|
|
|
|
|
|
(128, 0, 128): 'dark_purple',
|
|
|
|
|
(128, 128, 128): 'gray',
|
|
|
|
|
(128, 0, 255): 'purple',
|
|
|
|
|
(255, 0, 128): 'dark_pink',
|
|
|
|
|
(0, 128, 0): 'lime',
|
|
|
|
|
(0, 255, 128): 'mint',
|
|
|
|
|
(128, 255, 0): 'salad'
|
|
|
|
|
(255, 0, 255): 'pink',
|
|
|
|
|
|
|
|
|
|
(192, 192, 192): 'light_gray',
|
|
|
|
|
(128, 128, 128): 'gray',
|
|
|
|
|
(64, 64, 64): 'dark_gray',
|
|
|
|
|
(0, 0, 0): 'black'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#CONVERT for main.py
|
|
|
|
|
#from collections import OrderedDict
|
|
|
|
|
#new_colors = dict((value, key) for key, value in COLORS.items())
|
|
|
|
|
#print(new_colors)
|
|
|
|
|
#exit(0)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
img = Image.open('image.png')
|
|
|
|
|
pixels = img.load()
|
|
|
|
|
|
|
|
|
|