问题
This is what photoshop produces for the "average blur" of the Mona Lisa image for each respective quarter. What is the algorithm for doing so? I am looking to replicate it in a simple manner.:
Thanks.
回答1:
There is no way to be sure of that unless you can get the source code of Photoshop but the usual way to do this is to :
- add all the r, g, b values of every pixel in the quarter;
- divide the sum of those values by the number of pixel in the quarter;
- create a new color with the resulting r, g, b values.
This new color is the average color of the quarter.
For more information and complete code look here.
来源:https://stackoverflow.com/questions/26498619/how-does-photoshop-calculate-the-average-blur-average-color-of-an-image