|
|
@ -3,25 +3,56 @@ from PIL import Image
|
|
|
|
|
|
|
|
|
|
|
|
COLORS = {
|
|
|
|
COLORS = {
|
|
|
|
(255, 255, 255): 'white',
|
|
|
|
(255, 255, 255): 'white',
|
|
|
|
(0, 0, 255): 'blue',
|
|
|
|
|
|
|
|
(255, 0, 0): 'red',
|
|
|
|
(255, 0, 0): 'light_red',
|
|
|
|
(0, 255, 0): 'lime',
|
|
|
|
(192, 0, 0): 'red',
|
|
|
|
(0, 0, 0): 'black',
|
|
|
|
(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, 128, 0): 'orange',
|
|
|
|
|
|
|
|
|
|
|
|
(255, 255, 0): 'yellow',
|
|
|
|
(255, 255, 0): 'yellow',
|
|
|
|
(0, 255, 255): 'cyan',
|
|
|
|
(255, 215, 0): 'light_gold',
|
|
|
|
(128, 0, 255): 'purple',
|
|
|
|
(185, 135, 10): 'dark_gold',
|
|
|
|
(255, 0, 255): 'pink',
|
|
|
|
(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, 128, 0): 'green',
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(0, 255, 255): 'cyan',
|
|
|
|
(0, 128, 255): 'light_blue',
|
|
|
|
(0, 128, 255): 'light_blue',
|
|
|
|
|
|
|
|
(0, 0, 255): 'blue',
|
|
|
|
|
|
|
|
(0, 65, 90): 'dark_blue',
|
|
|
|
|
|
|
|
|
|
|
|
(128, 0, 128): 'dark_purple',
|
|
|
|
(128, 0, 128): 'dark_purple',
|
|
|
|
(128, 128, 128): 'gray',
|
|
|
|
(128, 0, 255): 'purple',
|
|
|
|
(255, 0, 128): 'dark_pink',
|
|
|
|
(255, 0, 128): 'dark_pink',
|
|
|
|
(0, 128, 0): 'lime',
|
|
|
|
(255, 0, 255): 'pink',
|
|
|
|
(0, 255, 128): 'mint',
|
|
|
|
|
|
|
|
(128, 255, 0): 'salad'
|
|
|
|
(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')
|
|
|
|
img = Image.open('image.png')
|
|
|
|
pixels = img.load()
|
|
|
|
pixels = img.load()
|
|
|
|
|
|
|
|
|
|
|
|