Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

PHP Image processing Library what is the Grafika image special effects processing module?

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

Today, I will talk to you about what the PHP image processing library Grafika image special effects processing module is, many people may not know much about it. In order to make you understand better, the editor has summarized the following content for you. I hope you can get something according to this article.

Let's get to the point and go straight to the example and click on the link above for more information.

Image filtering, filter

Grafika provides 11 filter functions that can meet the needs of any situation in development.

Here is an operation method: apply: it can apply the filter effect to the picture.

Picture blurred

Use the Blur parameter to blur a picture

The range of ambiguity is 0-100. The higher the value is, the more blurred the picture is.

Use Grafika\ Grafika; $editor = Grafika::createEditor (); $editor- > open ($image,'yanying- smaller.jpg'); $filter = Grafika::createFilter ('Blur', 50); / / ambiguity is 10, ambiguity value is 0100$ editor- > apply ($image, $filter); / / apply filter to picture $editor- > save ($image,'yanying-blur.jpg')

We set the blur parameter to 50.

Picture brightness adjustment

Use Brightness to highlight or darken the picture

The range of luminance values is

-100 to-1, darken

The 0 picture has not changed.

1-100 picture variable

Use Grafika\ Grafika; $editor = Grafika::createEditor (); $editor- > open ($image,' yanying-smaller.jpg'); $filter = Grafika::createFilter ('Brightness',-50); $editor- > apply ($image, $filter); $editor- > save ($image,'333/yanying-Brightness-1.jpg')

Change the color of the picture

Use the Colorize parameter to change the image color by adjusting the three basic colors of the image: red, green and blue.

Color parameters (same range of red, green and blue)

Value-100 to-1, color reduction

If 0 means no change

A value of 1-100 indicates an increase in color value

Use Grafika\ Grafika; $editor = Grafika::createEditor (); $editor- > open ($image,' yanying-smaller.jpg'); $filter = Grafika::createFilter ('Colorize',-50 lad 50 Lili 50); $editor- > apply ($image, $filter); $editor- > save ($image,'333/yanying-Colorize.jpg')

Change the contrast of the picture

You can change the contrast of a picture by using the Contrast parameter

The value of contrast is about the same as before. From-100 to-1, the contrast decreases; 0 remains the same; from 1 to 100, the contrast increases.

I don't know exactly what is meant by contrast and Baidu on my own. after all, it's not a designer.

Use Grafika\ Grafika; $editor = Grafika::createEditor (); $editor- > open ($image,' yanying-smaller.jpg'); $filter = Grafika::createFilter ('Contrast', 50); $editor- > apply ($image, $filter); $editor- > save ($image,'333/yanying-Contrast.jpg')

Image noise

Using Dither to add noise to an image, the parameter values are only two diffusion: diffusion and ordered: regular

Use Grafika\ Grafika; $editor = Grafika::createEditor (); $editor- > open ($image,' yanying-smaller.jpg'); $filter = Grafika::createFilter ('Dither',' diffusion'); $editor- > apply ($image, $filter); $editor- > save ($image,'333/yanying-Dither-diffusion.jpg')

Image level adjustment

The parameter Gamma is not commonly used in normal times and can only be used in the professional image field. It can be understood as color level, which is the mathematical relationship between the luminance value of gray scale and the level of gray scale.

The Gamma function here is to correct the color levels of the image to make the image look more correct.

The range of numeric values here is only the minimum value and no * value as long as > = 1.0 is fine.

Use Grafika\ Grafika; $editor = Grafika::createEditor (); $editor- > open ($image,' yanying-smaller.jpg'); $filter = Grafika::createFilter ('Gamma', 2.0); $editor- > apply ($image, $filter); $editor- > save ($image,'333/yanying-Gamma.jpg')

Picture grayscale

Use Grayscale to discard all the colors of the picture, leaving only black and white, with no value.

Use Grafika\ Grafika; $editor = Grafika::createEditor (); $editor- > open ($image,' yanying-smaller.jpg'); $filter = Grafika::createFilter ('Grayscale'); $editor- > apply ($image, $filter); $editor- > save ($image,'333/yanying-Grayscale.jpg')

Image reverse color processing

The image is inverted, that is, it is similar to film.

Use the Invert parameter to achieve the inverse effect of the image, and there is no optional value.

Use Grafika\ Grafika; $editor = Grafika::createEditor (); $editor- > open ($image,' yanying-smaller.jpg'); $filter = Grafika::createFilter ('Invert'); $editor- > apply ($image, $filter); $editor- > save ($image,'333/yanying-Invert.jpg')

Picture pixel and rasterization

Is to convert vector graphics into dot matrix graphics composed of pixels, also known as rasterization. Anyone who works in ps should know that.

The value range of this parameter is as long as it is greater than or equal to 1. The larger the value, the larger the pixel.

Use Grafika\ Grafika; $editor = Grafika::createEditor (); $editor- > open ($image,' yanying-smaller.jpg'); $filter = Grafika::createFilter ('Pixelate',10); $editor- > apply ($image, $filter); $editor- > save ($image,'333/yanying-Pixelate-10.jpg')

Let's compare the value of 5 with the value of 10.

Picture sharpening

Image sharpening is to compensate the outline of the image, enhance the edge of the image and the grayscale jump part, so that the image becomes clear.

Sharpening can be handled using the parameter Sharpen, with a value of 1-100 (inclusive).

Use Grafika\ Grafika; $editor = Grafika::createEditor (); $editor- > open ($image,' yanying-smaller.jpg'); $filter = Grafika::createFilter ('Sharpen',50); $editor- > apply ($image, $filter); $editor- > save ($image,'333/yanying-Sharpen.jpg')

Let's take a value of 50 and see how it works.

Image finding edge

The edge of the image is detected by mathematical calculation, which is commonly used in ps.

The Sobel parameter is used here to achieve the same effect, and there is no optional value.

Use Grafika\ Grafika; $editor = Grafika::createEditor (); $editor- > open ($image,' yanying-smaller.jpg'); $filter = Grafika::createFilter ('Sobel'); $editor- > apply ($image, $filter); $editor- > save ($image,'333/yanying-Sobel.jpg')

After reading the above, do you have any further understanding of the PHP image processing library Grafika image special effects processing module? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report