>>> m1.putpixel((0,0),(1,2,3))
>>> asarray(m1)[0]
array([[ 1, 2, 3],
[ 1, 0, 252],
[ 1, 0, 252],
...,
[253, 0, 0],
[253, 0, 0],
[253, 0, 0]], dtype=uint8)
>>> m1.save('enc_png.jpg',"JPEG")
>>> m1 = Image.open('enc_png.jpg')
>>> asarray(m1)[0]
array([[ 0, 0, 211],
[ 0, 0, 219],
[ 1, 4, 231],
...,
[253, 0, 0],
[253, 0, 0],
[253, 0, 0]], dtype=uint8)
When I save the image into jpg the pixels change from (1,2,3) to (0,0,211). It works fine when I save it as png. How could I solve this issue?