Suppose I have a picture converted into an array
data1= numpy.asarray(source1.png)
data2= numpy.asarray(source2.png)
data3= numpy.asarray(source3.png)
data4= numpy.asarray(source4.png)
data5= numpy.asarray(source5.png)
As I understand if I were to print(data1) I would get an array that shows the RGB Value of each pixel at each given position.
Now I would like to compare all arrays data1, data2, data3, data 4, data5 and find the RGB value of each pixel that occurs the most often and output it as a new Array/ Picture
As an example: For position X1Y1 and X2Y1the the array would look like this
data1= [[0 0 255], [0 1 0]]
data2= [[0 0 255], [0 1 0]]
data3= [[0 0 255], [0 1 0]]
data4= [[0 0 254], [0 1 0]]
data5= [[0 0 254], [0 1 0]]
As [(0,0,255)] was the most common value for position X1Y1 and X2Y1, the new array would be saved as avg= [(0, 0, 255), (0, 1, 0)]
Is there a function that can do that? Did I understand arrays correctly?