If I have a numpy array like so:
[[[137 153 135]
[138 154 136]
[138 153 138]
...,
[134 159 153]
[136 159 153]
[135 158 152]]
...,
[ 57 44 34]
[ 55 47 37]
[ 55 47 37]]]
How can I apply a function to each [000 000 000] entry, modifying it?
# a = numpy array
for x in a:
for y in x:
y = modify(y)
What I'd like to achieve is modifying each (r,g,b) pixel in a PIL image that was converted to a numpy array.
modify()exactly do? It is easy to give an answer to this question, but we can only give an efficient answer if we know whatmodify()does.