PHP | imagefilledarc() Function Last Updated : 11 Jul, 2025 Comments Improve Suggest changes Like Article Like Report 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, $style ) Parameters: This function accepts nine parameters as mentioned above and described below: $image: It is returned by one of the image creation functions, such as imagecreatetruecolor(). It is used to create size of image.. $cx: This parameter is used to set the x-coordinate of the center. $cy: This parameter is used to set the y-coordinate of the center. $width: This parameter is used to set the arc width. $height: This parameter is used to set the arc height. $start: The arc start angle, in degrees. $end: The arc end angle, in degrees. 0° is located at the three-o'clock position, and the arc is drawn clockwise. $color: A color identifier created with imagecolorallocate(). $style: Suggest how to fill the image and its values can be any one among the value listed below. IMG_ARC_PIE IMG_ARC_CHORD IMG_ARC_NOFILL IMG_ARC_EDGED Return Values: This function returns True on success or False on failure. Below programs illustrate the imagefilledarc() function in PHP: Program 1: php <?php define("WIDTH", 300); define("HEIGHT", 300); // Create image. $img = imagecreate(WIDTH, HEIGHT); // Allocate colors. $bg = $white = imagecolorallocate($img, 0xFF, 0xFF, 0xFF); $green = imagecolorallocate($img, 0, 255, 0); // make pie arc. $center_x = (int)WIDTH/2; $center_y = (int)HEIGHT/2; imagerectangle($img, 0, 0, WIDTH-1, HEIGHT-1, $green); imagefilledarc($img, $center_x, $center_y, WIDTH/2, HEIGHT/2, 0, 220, $green, IMG_ARC_PIE); // Flush image. header("Content-Type: image/png"); imagepng($img); ?> Output: Program 2: php <?php // Create image $image = imagecreatetruecolor(100, 100); // Allocate some colors $red = imagecolorallocate($image, 0xFF, 0x00, 0x00); $darkred = imagecolorallocate($image, 0x90, 0x00, 0x00); // Make the 3D effect for ($i = 60; $i > 50; $i--) { imagefilledarc($image, 50, $i, 100, 50, 75, 360, $darkred, IMG_ARC_PIE); } imagefilledarc($image, 50, 50, 100, 50, 75, 360, $red, IMG_ARC_PIE); // flush image header('Content-type: image/png'); imagepng($image); imagedestroy($image); ?> Output: Reference: https://www.php.net/manual/en/function.imagefilledarc.php Comment More infoAdvertise with us Next Article Company Preparation V Vishal_Khoda Follow Improve Article Tags : Misc Web Technologies PHP Image-Processing PHP-function +1 More Practice Tags : Misc Similar Reads Interview PreparationInterview Preparation For Software DevelopersMust Coding Questions - Company-wise Must Do Coding Questions - Topic-wiseCompany-wise Practice ProblemsCompany PreparationCompetitive ProgrammingSoftware Design-PatternsCompany-wise Interview ExperienceExperienced - Interview ExperiencesInternship - Interview ExperiencesPractice @GeeksforgeeksProblem of the DayTopic-wise PracticeDifficulty Level - SchoolDifficulty Level - BasicDifficulty Level - EasyDifficulty Level - MediumDifficulty Level - HardLeaderboard !!Explore More...Data StructuresArraysLinked ListStackQueueBinary TreeBinary Search TreeHeapHashingGraphAdvance Data StructuresMatrixStringAll Data StructuresAlgorithmsAnalysis of AlgorithmsSearching AlgorithmsSorting AlgorithmsPattern SearchingGeometric AlgorithmsMathematical AlgorithmsRandomized AlgorithmsGreedy AlgorithmsDynamic ProgrammingDivide & ConquerBacktrackingBranch & BoundAll AlgorithmsProgramming LanguagesCC++JavaPythonC#Go LangSQLPHPScalaPerlKotlinWeb TechnologiesHTMLCSSJavaScriptBootstrapTailwind CSSAngularJSReactJSjQueryNodeJSPHPWeb DesignWeb BrowserFile FormatsComputer Science SubjectsOperating SystemsDBMSComputer NetworkComputer Organization & ArchitectureTOCCompiler DesignDigital Elec. & Logic DesignSoftware EngineeringEngineering MathematicsData Science & MLComplete Data Science CourseData Science TutorialMachine Learning TutorialDeep Learning TutorialNLP TutorialMachine Learning ProjectsData Analysis TutorialTutorial LibraryPython TutorialDjango TutorialPandas TutorialKivy TutorialTkinter TutorialOpenCV TutorialSelenium TutorialGATE CSGATE CS NotesGate CornerPrevious Year GATE PapersLast Minute Notes (LMNs)Important Topic For GATE CSGATE CoursePrevious Year Paper: CS exams Like