PHP | imagefilledellipse() Function Last Updated : 23 Aug, 2019 Comments Improve Suggest changes Like Article Like Report The imagefilledellipse() function is an inbuilt function in PHP which is used to draw the filled ellipse. It draws the ellipse with specified center coordinate. Syntax: bool imagefilledellipse( $image, $cx, $cy, $width, $height, $color ) Parameters: This function accepts six parameters as mentioned above and described below: $image: The imagecreatetruecolor() function is used to create a blank image in a given size. $cx: x-coordinate of the center. $cy: y-coordinate of the center. $width: The ellipse width. $height: The ellipse height. $color: The fill color. A color identifier created with imagecolorallocate(). Return Value: This function returns TRUE on success or FALSE on failure. Below programs illustrate the imagefilledellipse() function in PHP. Program 1: php <?php // It create the size of image or blank image. $image = imagecreatetruecolor(500, 300); // Set the background color of image. $bg = imagecolorallocate($image, 205, 220, 200); // Fill background with above selected color. imagefill($image, 0, 0, $bg); // Set the color of an ellipse. $col_ellipse = imagecolorallocate($image, 0, 102, 0); // Function to draw the filled ellipse. imagefilledellipse($image, 250, 150, 400, 250, $col_ellipse); // Output of the image. header("Content-type: image/png"); imagepng($image); ?> Output: Program 2: php <?php // It create the size of image or blank image. $image = imagecreatetruecolor(300, 500); // Set the background color of image. $bg = imagecolorallocate($image, 205, 220, 200); // Fill background with above selected color. imagefill($image, 0, 0, $bg); // set color of ellipse. $col_ellipse = imagecolorallocate($image, 0, 102, 0); // function to draw the filled ellipse with white color. imagefilledellipse($image, 150, 250, 250, 400, $col_ellipse); // output of the image. header("Content-type: image/png"); imagepng($image); ?> Output: You can try making a circle too using the same function. Related Article: PHP | imageellipse() Function Reference: http://php.net/manual/en/function.imagefilledellipse.php Comment More infoAdvertise with us Next Article PHP | imagefilledellipse() Function V Vishal_Khoda Follow Improve Article Tags : PHP Similar Reads PHP | imageellipse() Function The imageellipse() function is an inbuilt function in PHP which is used to draw an ellipse. This function returns TRUE on success or FALSE on failure. Syntax: bool imageellipse( $image, $cx, $cy, $width, $height, $color ) Parameters: This function accepts six parameters as mentioned above and descri 2 min read PHP | imagefilledrectangle() Function The imagefilledrectangle() function is an inbuilt function in PHP which is used to create a filled rectangle. This function creates a rectangle filled with a given color in the image. The top left corner of the image is (0, 0). Syntax: bool imagefilledrectangle( $image, $x1, $y1, $x2, $y2, $color ) 2 min read PHP | imagefill() Function The imagefill() function is an inbuilt function in PHP which is used to fill the image with the given color. This function performs a flood fill starting at the given coordinate (top left is 0, 0) with the given color in the image. Syntax: bool imagefill( $image, $x, $y, $color ) Parameters:This fun 2 min read PHP | imagefilledarc() Function The imagefilledarc() function is an inbuilt function in PHP which is used to draws a partial arc centered at the specified coordinate in the given image. This function return True on success or False on failure Syntax: bool imagefilledarc ( $image, $cx, $cy, $width, $height, $start, $end, $color, $s 2 min read PHP | imagefilledpolygon() Function The imagefilledpolygon() function is an inbuilt function in PHP which is used to draw a filled polygon. This function Returns TRUE on success and returns FALSE otherwise. Syntax:Â bool imagefilledpolygon( $image, $points, $num_points, $color ) Parameters: This function accepts four parameters as men 2 min read Like