Why does IMG_FILTER_CONTRAST in example 1 produce a brighter image then in example 2 can someone explain the IMG_FILTER_CONTRAST parameter in more detail me as why this happens?
Example 1
imagefilter($image, IMG_FILTER_CONTRAST, 255开发者_StackOverflow);
Example 2
imagefilter($image, IMG_FILTER_CONTRAST, 100);
According to PHP: imagefilter - Manual, it looks like 255 is outside of the range of values for IMG_FILTER_CONTRAST
.
The documentation misses the exact meaning and valid ranges of the arguments for
ImageFilter()
. According to the 5.2.0 sources the arguments are:
...
IMG_FILTER_CONTRAST
-100 = max contrast, 0 = no change, +100 = min contrast (note the direction!)
As PanuWorld outlines in a comment in the docs - link
"...IMG_FILTER_CONTRAST
-100 = max contrast, 0 = no change, +100 = min contrast (note the direction!)
"...
What do you want to hear from us as the manual says it is the constrast level and you are using different values in both calls.
That's why the output is different.
IMG_FILTER_CONTRAST: Changes the contrast of the image. Use arg1 to set the level of contrast.
IMG_FILTER_CONTRAST: Contrast level.
http://en.wikipedia.org/wiki/Contrast_(vision)
精彩评论