wp_imagecreatetruecolor( int $width, int $height ): resource|GdImage|false

Creates new GD image resource with transparency support.


Parameters

$width int Required
Image width in pixels.
$height int Required
Image height in pixels.

Top ↑

Return

resource|GdImage|false The GD image resource or GdImage instance on success.
False on failure.


Top ↑

Source

File: wp-includes/media.php. View all references

function wp_imagecreatetruecolor( $width, $height ) {
	$img = imagecreatetruecolor( $width, $height );

	if ( is_gd_image( $img )
		&& function_exists( 'imagealphablending' ) && function_exists( 'imagesavealpha' )
	) {
		imagealphablending( $img, false );
		imagesavealpha( $img, true );
	}

	return $img;
}


Top ↑

Changelog

Changelog
Version Description
2.9.0 Introduced.

Top ↑

User Contributed Notes

You must log in before being able to contribute a note or feedback.