本文介绍了快速获得图像的亮度/亮度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用php,逐像素地浏览每个图像以获得每个图像的平均亮度,这将成为cpu密集型的...

I'm working in php, and going through each image pixel-by-pixel to get an average brightness for each image is going to be way to cpu intensive...

我查看了GD和imagemagick文档,但还没有找到一种方法来返回图像的平均亮度......这可以在这些库中快速完成,也可以在另一个容易访问的包中完成php?

I've looked through both GD and imagemagick docs, but haven't found a way to return the average brightness of an image... Can this be done quickly either in these libraries, or in another package easily accessible by php?

推荐答案

是一篇有趣的帖子,使用用于计算图像的平均灰度等级。这篇文章还讨论了Mark Ransom使用ImageMagick将尺寸减小到1x1的技术。

Here is an interesting post using ImageMagick for computing the average graylevel of an image. This post also discusses Mark Ransom's technique of size reduction to 1x1 using ImageMagick.

这篇关于快速获得图像的亮度/亮度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-28 22:17