The imagecreatetruecolor() function creates a new true color image.
Syntax
imagecreatetruecolor (width , height )
Parameters
width: The image width.
height: The image height.
Return
The imagecreatetruecolor() function returns an image resource identifier on success, FALSE on errors.
Example
The following is an example
<?php $img = imagecreatetruecolor(600, 500); echo imagesy($img); echo "<br>"; echo imagesx($img); ?>
Output
The following is the output displaying the height and width of the new image:
500 600
Example
Let us see another example with different height and width:
<?php $img = imagecreatetruecolor(300, 450); echo imagesy($img); echo "<br>"; echo imagesx($img); ?>
Output
The following is the output displaying the height and width of the new image:
450 300