This site explains RBG colors well, and the mouse can hover over a color to see the values.
https://www.rapidtables.com/web/color/RGB_Color.html
There are other tables as well.
Let a gradient be 256 pixels wide.
There are only 256 values for each R, G, or B number.
So a gradient made up of grey colors, from White to Black, could have RGB numbers such
that Rnum = Gnum = Bnum, in the integer range of 0...255.
The numbers for White are ( 255, 255, 255 )
The numbers for Black are ( 0, 0, 0 )
The average of the three numbers could be used.
To add up various sums of numbers, each should be subtracted from 255, to invert a White to Black gradient, to calculate when a sum exceeds a threshold number. (Assuming MoI points are more dense for darker regions.)
For 256 pixels the sum of the numbers could be an arithmetic series. As well as sums of sequential terms of subsets of the values.
The number of terms whose sum exceeds a threshold number can be calculated, with other than brute force:
https://math.stackexchange.com/questions/1624580/how-many-terms-in-arithmetic-series-where-sum-1000
Such a gradient image that is 512 pixels wide could have pairs with the same average value of the pixels.
- Brian