diff --git a/im_convert.py b/im_convert.py index c76a261..be6b174 100644 --- a/im_convert.py +++ b/im_convert.py @@ -80,6 +80,16 @@ for i in range(len(inverted_list)): inverted_y = img.size[1] - y - 1 inverted_list[i] = [x,inverted_y , color_name] +# создаем новое изображение и заполняем его пикселями из списка +new_img = Image.new('RGB', (img.size[0], img.size[1]), color='white') +new_pixels = new_img.load() +for x, y, color in result_list: + rgb = [key for key, value in COLORS.items() if value == color][0] + new_pixels[x, y] = rgb + +new_img.show() + + # смещение!!!!!!!!!!!!!!!!!!!!! #------------------------------------------------- move = [0, 0] @@ -105,17 +115,6 @@ f = open("out.txt",'w') f.write(str(res_list)) f.close() -# создаем новое изображение и заполняем его пикселями из списка -new_img = Image.new('RGB', (img.size[0], img.size[1]), color='white') -new_pixels = new_img.load() -for x, y, color in result_list: - rgb = [key for key, value in COLORS.items() if value == color][0] - new_pixels[x, y] = rgb - - - - -new_img.show() from bot import * from remove_back import *