I have a picture (jpg file, for example).
I need to know "overall average" the color of the picture. I mean the prevailing color in this picture. I can not strictly furmulate my task.
I will cite an example:
(Image above: at the top - the original image, at the bottom - the "overall average" color which is associated with picture)
If you help me to formulate a strictly my task I shall be very grateful. At first glance there can use the histogram of the image (channel RGB).
Supplement: at work I use mostly JavaScript and PHP (a little Python) therefore welcomed the decision in these languages. Maybe ther are library for working with images that address similar problems.
Supplement NO2:I do not need to dynamically determine the color of the picture. I need just once go through the entire array of images and determine the color of each separately (this information I will remember for future use).