开发者

PHP imagefilter parameter IMG_FILTER_SMOOTH value ranges question?

what is the value range I can use for the imagefilter function parameter IMG_FILTER_SMO开发者_JS百科OTH?


It looks like there's no real limit to the range, at least not in any documentation I've seen. However, there is a short explanation of the value here:

There isn't enough room here to go into a full discussion of what these manipulation matrices are, but suffice to say you can represent many different transformations - from Gaussian blur to edge detection - using a 3x3 numerical matrix that defines how the colours of the eight pixels surrounding any given pixel (with the pixel itself being the ninth) should have their RGB values changed. With IMG_FILTER_SMOOTH, the parameter you pass is used as the change value for the pixel itself, which means you get to define how much the pixel's own colour is used to form its final color.

You're not likely to want values outside of the range -8 to 8, as even one number makes quite a big difference. At about 10 the picture is almost normal because the original pixel values are given more weight than the combined sum of its neighbours, but you can get some really neat effects between -6 to -8 - do play around and see what you can come up with.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜