How does photoshop calculate the “average blur” (average color) of an image?

て烟熏妆下的殇ゞ 提交于 2020-01-05 07:40:09

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!