Reputation: 367
I have a multidimensional array of the red pixels in the picture. And I'm adjusting it to make a new picture using the new red pixels that I have changed. I'm still keeping the blue and green and I'm not changing those. When I print out the red pixels to see if their correct before I saved the new picture everything is right Until I actually check the new picture by opening and displaying the red values thats when the values are wrong. Heres the code:
from PIL import Image
import numpy as np
picture = Image.open('flower.jpg')
red, green, blue = np.array(picture).T
print red
picture.save('output.jpg')
The output of the first print statement the red pixels of picture:
[[112 114 111 ..., 12 13 7]
[111 112 112 ..., 13 15 11]
[111 110 110 ..., 12 17 17]
...,
[181 180 180 ..., 25 17 11]
[180 181 182 ..., 18 14 9]
[179 179 179 ..., 13 14 15]]
Upvotes: 3
Views: 176