Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

📚 The CoCalc Library - books, templates and other resources

132939 views
License: OTHER
1
public static int getAverageColor(int[][] image) {
2
int sum = 0;
3
for (int x = 0; x < image.length; x++) {
4
for (int y = 0; y < image[0].length; y++) {
5
sum += image[x][y];
6
}
7
}
8
return sum / (image.length * image[0].length);
9
}
10
11