wp_imagecreatetruecolor()WP 2.9.0

Creates a new GD image resource with transparency support.

No Hooks.

Return

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

Usage

wp_imagecreatetruecolor( $width, $height );
$width(int) (required)
Image width in pixels.
$height(int) (required)
Image height in pixels.

Changelog

Since 2.9.0 Introduced.

wp_imagecreatetruecolor() code WP 6.4.3

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;
}