WordPress at a glance
function is not described

wp_imagecreatetruecolor() WP 2.9.0

Create new GD image resource with transparency support

No Hooks.


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


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


Since 2.9.0 Introduced.

Code of wp_imagecreatetruecolor() WP 5.7.1

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;