Server Side Programming Articles

Page 1051 of 2109

imageconvolution() function in PHP

Chandu yadav
Chandu yadav
Updated on 15-Mar-2026 192 Views

The imageconvolution() function in PHP applies a convolution matrix to an image resource. This function is used for image filtering effects like sharpening, blurring, edge detection, and embossing. Syntax bool imageconvolution(resource $image, array $matrix, float $div, float $offset) Parameters image − An image resource created by functions like imagecreatetruecolor() or imagecreatefromgif(). matrix − A 3x3 matrix represented as an array of three arrays, each containing three float values. div − The divisor used for normalization of the convolution result. Used to control the brightness of the output. offset − Color offset value added ...

Read More

imagecolormatch() function in PHP

Ankith Reddy
Ankith Reddy
Updated on 15-Mar-2026 130 Views

The imagecolormatch() function adjusts the colors of a palette image to more closely match those of a true color image. This function is useful when you need to optimize a palette-based image to better represent the original true color version. Syntax bool imagecolormatch(resource $img1, resource $img2) Parameters img1 − A true color image resource created with imagecreatetruecolor() function. img2 − A palette image resource with the same dimensions as img1. This image's palette will be modified to match img1. Return Value The function returns TRUE on success or FALSE on ...

Read More

imagecolortransparent() function in PHP

George John
George John
Updated on 15-Mar-2026 373 Views

The imagecolortransparent() function in PHP sets a specific color in an image to be transparent. This is particularly useful when creating images with transparent backgrounds or when overlaying images. Syntax imagecolortransparent(resource $image [, int $color]) Parameters image − An image resource created by functions like imagecreatetruecolor() or imagecreate(). color (optional) − Color identifier created with imagecolorallocate(). If not specified, returns the current transparent color. Return Value The function returns the identifier of the new transparent color when a color is set. If no color parameter is provided, it returns the ...

Read More

imagecolorresolve() function in PHP

Arjun Thakur
Arjun Thakur
Updated on 15-Mar-2026 70 Views

The imagecolorresolve() function gets the index of the specified color or its closest possible alternative in a palette-based image. This function is useful when working with palette images where exact color matches might not be available. Syntax imagecolorresolve(resource $image, int $red, int $green, int $blue) Parameters image − An image resource created by functions like imagecreate() or imagecreatefromgif(). red − The value of the red component (0-255). green − The value of the green component (0-255). blue − The value of the blue component (0-255). Return Value Returns the color ...

Read More

imagecolorset() function in PHP

Ankith Reddy
Ankith Reddy
Updated on 15-Mar-2026 161 Views

The imagecolorset() function modifies the color of a specific palette index in palette-based images. This is particularly useful for creating flood-fill-like effects where you want to change all pixels of a particular color to a new color. Syntax imagecolorset(resource $image, int $index, int $red, int $green, int $blue [, int $alpha]) Parameters image − An image resource created by functions like imagecreate() index − The palette index to modify (0-255) red − Red component value (0-255) green − Green component value (0-255) blue − Blue component value (0-255) alpha − Transparency level (0-127, ...

Read More

imagecolorsforindex() function in PHP

George John
George John
Updated on 15-Mar-2026 141 Views

The imagecolorsforindex() function in PHP retrieves the RGBA color values for a specific color index in an image. This is useful when you need to analyze or manipulate colors at specific positions in an image. Syntax imagecolorsforindex(resource $image, int $index) Parameters image − An image resource created by image creation functions like imagecreate() or imagecreatefrompng() index − The color index value obtained from functions like imagecolorat() Return Value Returns an associative array containing four keys: red, green, blue, and alpha with their corresponding integer values (0-255 for RGB, 0-127 for ...

Read More

imagecolorresolvealpha() function in PHP

Arjun Thakur
Arjun Thakur
Updated on 15-Mar-2026 90 Views

The imagecolorresolvealpha() function in PHP gets the index of a specified color with alpha transparency in an image's palette. If the color doesn't exist, it allocates a new color index or returns the closest match. Syntax imagecolorresolvealpha(resource $image, int $red, int $green, int $blue, int $alpha) Parameters image − An image resource created by functions like imagecreatetruecolor() or imagecreatefromgif() red − Red component value (0-255) green − Green component value (0-255) blue − Blue component value (0-255) alpha − Alpha transparency value (0-127), where 0 is completely opaque and 127 is completely transparent ...

Read More

imagecopymerge() function in PHP

Chandu yadav
Chandu yadav
Updated on 15-Mar-2026 888 Views

The imagecopymerge() function copies and merges part of one image onto another with specified transparency. This function is useful for creating watermarks, overlays, or blending images together. Syntax imagecopymerge(dst_img, src_img, dst_x, dst_y, src_x, src_y, src_w, src_h, pct) Parameters dst_img − Destination image resource src_img − Source image resource dst_x − X-coordinate of destination point dst_y − Y-coordinate of destination point src_x − X-coordinate of source point src_y − Y-coordinate ...

Read More

imagechar() function in PHP

Chandu yadav
Chandu yadav
Updated on 15-Mar-2026 215 Views

The imagechar() function in PHP draws a single character horizontally on an image. This function is useful for adding text elements to dynamically generated images. Syntax bool imagechar(resource $image, int $font, int $x, int $y, string $c, int $color) Parameters image − An image resource created by functions like imagecreate() or imagecreatetruecolor() font − Font size (1-5 for built-in fonts, or a loaded font identifier) x − x-coordinate for the character position y − y-coordinate for the character position c − The character to draw (only the first character of the string is ...

Read More

imagearc() function in PHP

Arjun Thakur
Arjun Thakur
Updated on 15-Mar-2026 426 Views

The imagearc() function in PHP is used to draw arcs and circles on images. It's part of the GD library and allows you to create curved lines with specified angles and dimensions. Syntax imagearc($img, $cx, $cy, $width, $height, $start, $end, $color) Parameters $img − Image resource created with imagecreatetruecolor() or similar functions. $cx − x-coordinate of the arc's center. $cy − y-coordinate of the arc's center. $width − Width of the ellipse containing the arc. $height − Height of the ellipse containing the arc. $start − Starting angle in degrees (0° is at ...

Read More
Showing 10501–10510 of 21,090 articles
Advertisements