def test(): width_qr = img_test.size[0] height_qr = img_test.size[1] for i in range(0,width_qr): for j in range(0,height_qr): img_test.putpixel((i, j), (255, 255, 254, 1)) img = img_test.convert("RGB") img.save("F:/p/test2.jpg") img_test1 = Image.open("F:/p/test2.jpg") width_test = img_test1.size[0] heigth_test = img_test1.size[1] for i in range(0,width_test): for j in range(0,heigth_test): data = (img_test1.getpixel((i, j))) print(data)