|
LibGd 2.4.0-dev
GD Graphics library
|
Data Structures | |
| struct | gdScatter |
| Options to Scatter an image. More... | |
Enumerations | |
| enum | gdPixelateMode { GD_PIXELATE_UPPERLEFT , GD_PIXELATE_AVERAGE } |
| gdImagePixelate options More... | |
Functions | |
| int | gdImagePixelate (gdImagePtr im, int block_size, const unsigned int mode) |
| Pixelates an image. | |
| int | gdImageScatter (gdImagePtr im, int sub, int plus) |
| Scatter an image. | |
| int | gdImageScatterColor (gdImagePtr im, int sub, int plus, int colors[], unsigned int num_colors) |
| Scatter an image with specified colors. | |
| int | gdImageScatterEx (gdImagePtr im, gdScatterPtr s) |
| Scatter an image with extended options. | |
| int | gdImageSmooth (gdImagePtr im, float weight) |
| Smooth an image. | |
| int | gdImageMeanRemoval (gdImagePtr im) |
| Mean removal of an image. | |
| int | gdImageEmboss (gdImagePtr im) |
| Emboss an image. | |
| int | gdImageGaussianBlur (gdImagePtr im) |
| Gaussian blur of an image Performs a Gaussian blur of radius 1 on the image. The image is modified in place. | |
| int | gdImageEdgeDetectQuick (gdImagePtr src) |
| Edge detection of an image. | |
| int | gdImageSelectiveBlur (gdImagePtr src) |
| Selective blur of an image. | |
| int | gdImageConvolution (gdImagePtr src, float filter[3][3], float filter_div, float offset) |
| Apply a convolution matrix to an image. | |
| int | gdImageColor (gdImagePtr src, const int red, const int green, const int blue, const int alpha) |
| Change channel values of an image. | |
| int | gdImageContrast (gdImagePtr src, double contrast) |
| Change the contrast of an image. | |
| int | gdImageBrightness (gdImagePtr src, int brightness) |
| Change the brightness of an image. | |
| int | gdImageGrayScale (gdImagePtr src) |
| Convert an image to grayscale. | |
| int | gdImageNegate (gdImagePtr src) |
| Invert an image. | |
| gdImagePtr | gdImageCopyGaussianBlurred (gdImagePtr src, int radius, double sigma) |
| Return a copy of the source image src blurred according to the parameters using the Gaussian Blur algorithm. Return a copy of the source image src blurred according to the parameters using the Gaussian Blur algorithm. | |
| enum gdPixelateMode |
gdImagePixelate options
Negate the imag src, white becomes black, The red, green, and blue intensities of an image are negated. White becomes black, yellow becomes blue, etc.
| Enumerator | |
|---|---|
| GD_PIXELATE_UPPERLEFT | Use the upper-left pixel of each block |
| GD_PIXELATE_AVERAGE | Use the average color of each block |
| int gdImageBrightness | ( | gdImagePtr | src, |
| int | brightness | ||
| ) |
Change the brightness of an image.
| src | The image. |
| brightness | The value to add to the color channels of all pixels. |
| int gdImageColor | ( | gdImagePtr | src, |
| const int | red, | ||
| const int | green, | ||
| const int | blue, | ||
| const int | alpha | ||
| ) |
Change channel values of an image.
| src | The image. |
| red | The value to add to the red channel of all pixels. |
| green | The value to add to the green channel of all pixels. |
| blue | The value to add to the blue channel of all pixels. |
| alpha | The value to add to the alpha channel of all pixels. |
| int gdImageContrast | ( | gdImagePtr | src, |
| double | contrast | ||
| ) |
Change the contrast of an image.
| src | The image. |
| contrast | The contrast adjustment value. Negative values increase, postive values decrease the contrast. The larger the absolute value, the stronger the effect. |
| int gdImageConvolution | ( | gdImagePtr | src, |
| float | filter[3][3], | ||
| float | filter_div, | ||
| float | offset | ||
| ) |
Apply a convolution matrix to an image.
Depending on the matrix, a wide range of effects can be accomplished, e.g. blurring, sharpening, embossing, and edge detection.
| src | The image. |
| filter | The 3x3 convolution matrix. |
| filter_div | The value to divide the convoluted channel values by. |
| offset | The value to add to the convoluted channel values. |
| gdImagePtr gdImageCopyGaussianBlurred | ( | gdImagePtr | src, |
| int | radius, | ||
| double | sigma | ||
| ) |
Return a copy of the source image src blurred according to the parameters using the Gaussian Blur algorithm. Return a copy of the source image src blurred according to the parameters using the Gaussian Blur algorithm.
radius is a radius, not a diameter so a radius of 2 (for example) will blur across a region 5 pixels across (2 to the center, 1 for the center itself and another 2 to the other edge).
sigma represents the "fatness of the curve (lower == fatter). If <em>sigma</em> is less than or equal to 0, <gdImageCopyGaussianBlurred> ignores it and instead computes an "optimal" value. Be warned that future versions of this function may compute sigma differently. The resulting image is always truecolor. More Details: A Gaussian Blur is generated by replacing each pixel's color values with the average of the surrounding pixels' colors. This region is a circle whose radius is given by argument <em>radius</em>. Thus, a larger radius will yield a blurrier image. This average is not a simple mean of the values. Instead, values are weighted using the Gaussian function (roughly a bell curve centered around the destination pixel) giving it much more influence on the result than its neighbours. Thus, a fatter curve will give the center pixel more weight and make the image less blurry; lower <em>sigma</em> values will yield flatter curves. Currently, <gdImageCopyGaussianBlurred> computes the default sigma as (2/3)*radius Note, however that we reserve the right to change this if we find a better ratio. If you absolutely need the current sigma value, you should set it yourself. @param src the source image @param radius the blur radius (<em>not</em> diameter–range is 2*radius + 1) @param sigma the sigma value or a value <= 0.0 to use the computed default @return The new image or NULL if an error occurred. The result is always truecolor. Example: @code FILE *in; gdImagePtr result, src; in = fopen("foo.png", "rb"); src = gdImageCreateFromPng(in);
result = gdImageCopyGaussianBlurred(im, src->sx / 10, -1.0);
| int gdImageEdgeDetectQuick | ( | gdImagePtr | src | ) |
Edge detection of an image.
(see edge_detect_quick.jpg)
| src | The image. |
| int gdImageEmboss | ( | gdImagePtr | im | ) |
Emboss an image.
(see emboss.jpg)
| im | The image. |
| int gdImageGaussianBlur | ( | gdImagePtr | im | ) |
Gaussian blur of an image Performs a Gaussian blur of radius 1 on the image. The image is modified in place.
NOTE: You will almost certain want to use gdImageCopyGaussianBlurred instead, as it allows you to change your kernel size and sigma value. Future versions of this function may fall back to calling it instead of gdImageConvolution, causing subtle changes so be warned.
| im | The image to blur. |
| int gdImageGrayScale | ( | gdImagePtr | src | ) |
Convert an image to grayscale.
The red, green and blue components of each pixel are replaced by their weighted sum using the same coefficients as the REC.601 luma (Y') calculation. The alpha components are retained.
For palette images the result may differ due to palette limitations.
| src | The image. |
| int gdImageMeanRemoval | ( | gdImagePtr | im | ) |
Mean removal of an image.
(see mean_removal.jpg)
| im | The image. |
| int gdImageNegate | ( | gdImagePtr | src | ) |
Invert an image.
| src | The image. |
| int gdImagePixelate | ( | gdImagePtr | im, |
| int | block_size, | ||
| const unsigned int | mode | ||
| ) |
Pixelates an image.
Pixelates an image by dividing it into blocks of the specified size and replacing each block with a single color. The color can be determined by either the upper-left pixel of the block or the average color of all pixels in the block, depending on the mode specified.
| im | The image to pixelate. |
| block_size | The size of the blocks to use for pixelation. Must be greater than 0. |
| mode | The mode to use for determining the color of each block. gdPixelateMode |
| int gdImageScatter | ( | gdImagePtr | im, |
| int | sub, | ||
| int | plus | ||
| ) |
Scatter an image.
Scatters the pixels of an image by randomly adjusting their color values based on the specified subtraction and addition values.
| im | The image to scatter. |
| sub | The subtraction value for scattering. Must be greater than or equal to 0. |
| plus | The addition value for scattering. Must be greater than or equal to 0 |
| int gdImageScatterColor | ( | gdImagePtr | im, |
| int | sub, | ||
| int | plus, | ||
| int | colors[], | ||
| unsigned int | num_colors | ||
| ) |
Scatter an image with specified colors.
Scatters the pixels of an image by randomly adjusting their color values based on the specified subtraction and addition values, using a specified set of colors.
| im | The image to scatter. |
| sub | The subtraction value for scattering. Must be greater than or equal to 0. |
| plus | The addition value for scattering. Must be greater than or equal to 0. |
| colors | An array of colors to use for scattering. Must not be NULL. |
| num_colors | The number of colors in the colors array. Must be greater than |
| int gdImageScatterEx | ( | gdImagePtr | im, |
| gdScatterPtr | s | ||
| ) |
Scatter an image with extended options.
Scatters the pixels of an image using the specified scattering options.
| im | The image to scatter. |
| s | A pointer to a gdScatter structure containing the scattering options. Must not be NULL. |
| int gdImageSelectiveBlur | ( | gdImagePtr | src | ) |
Selective blur of an image.
| src | The image. |
| int gdImageSmooth | ( | gdImagePtr | im, |
| float | weight | ||
| ) |
Smooth an image.
(see smooth.jpg)
| im | The image. |
| weight | The strength of the smoothing. |
Smooth an image
Smooth an image
(see smooth.jpg)
| src | The source image. |
| weight | The strength of the smoothing. |