PHP | imagecreatefromjpeg() Function Last Updated : 30 Jan, 2020 Comments Improve Suggest changes Like Article Like Report The imagecreatefromjpeg() function is an inbuilt function in PHP which is used to create a new image from JPEG file or URL. This image can be further worked upon in the program. Syntax: resource imagecreatefromjpeg( string $filename ) Parameters: This function accepts a single parameter, $filename which holds the name of image Return Value: This function returns an image resource identifier on success, FALSE on errors. Below examples illustrate the imagecreatefromjpeg() function in PHP: Example 1: [tabby title="php"] php <?php // Load an image from jpeg URL $im = imagecreatefromjpeg( 'https://media.geeksforgeeks.org/wp-content/uploads/20200123100652/geeksforgeeks12.jpg'); // View the loaded image in browser header('Content-type: image/jpg'); imagejpeg($im); imagedestroy($im); ?> Output: Example 2: php <?php // Load an image from jpeg URL $im = imagecreatefromjpeg( 'https://media.geeksforgeeks.org/wp-content/uploads/20200123100652/geeksforgeeks12.jpg'); // Flip the image imageflip($im, 1); // View the loaded image in browser header('Content-type: image/jpg'); imagejpeg($im); imagedestroy($im); ?> Output: Reference: https://www.php.net/manual/en/function.imagecreatefromjpeg.php Comment More infoAdvertise with us Next Article PHP | imagecreatefromjpeg() Function gurrrung Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-Imagick Similar Reads PHP | imagecreatefrompng() Function The imagecreatefrompng() function is an inbuilt function in PHP which is used to create a new image from PNG file or URL. This image can be further worked upon in the program. This function is usually used when you want to edit your PNG images. Syntax: resource imagecreatefrompng( string $filename ) 1 min read PHP | imagecreatefromgd() function The imagecreatefromgd() function is an inbuilt function in PHP which is used to create a new image from GD file or URL. Further, this image can be worked upon in the program. An image can be converted into GD format using the imagegd() function. Syntax: resource imagecreatefromgd( string $filename ) 2 min read PHP | imagecreatefromgd2() function The imagecreatefromgd2() function is an inbuilt function in PHP which is used to create a new image from file or URL. Further, this image can be worked upon in the program. Usually, gd2 extension is not supported in the browser thus it can be used to convert it into png and view it in the browser.Sy 1 min read PHP | imagecreatefrombmp() Function The imagecreatefrombmp() function is an inbuilt function in PHP which is used to create a new image from file or URL. Syntax: resource imagecreatefrombmp( string $filename ) Parameters: This function accepts a single parameter $filename which holds the name or URL of a file. Return Value: This funct 1 min read PHP | imagecreatefromxpm() Function The imagecreatefromxpm() function is an inbuilt function in PHP which is used to create a new image from XPM file or URL. XPM (X PixMap) is an image file format used by the X Window System. This loaded image can be further worked upon in the program. This function is usually used when you want to ed 2 min read PHP | imagecreatefromgif() Function The imagecreatefromgif() function is an inbuilt function in PHP which is used to create a new image from a given part of GIF file or URL. Further, this image can be worked upon in the program. This function only loads the first frame of the animation. Syntax: resource imagecreatefromgif( string $fil 1 min read PHP | imagecreatefromwbmp() Function The imagecreatefromwbmp() function is an inbuilt function in PHP which is used to create a new image from WBMP file or URL. WBMP (Wireless Application Protocol Bitmap Format) is a monochrome graphics file format optimized for mobile computing devices. This loaded image can be further worked upon in 2 min read PHP | imagecreatefromwebp() function The imagecreatefromwebp() function is an inbuilt function in PHP which is used to create a new image from WEBP file or URL. WEBP is an image format employing both lossy and lossless compression. This image can be further worked upon in the program. This function is usually used when you want to edit 2 min read PHP | imagecreatefromxbm() function The imagecreatefromxbm() function is an inbuilt function in PHP which is used to create a new image from XBM file or URL. XBM file extension is an X Bitmap Graphics file used for Graphical UI systems. This loaded image can be further worked upon in the program. This function is usually used when you 2 min read PHP | imagecreatefromstring() Function The imagecreatefromstring() function is an inbuilt function in PHP which is used to create a new image from string file or URL. This image can be further worked upon in the program. This function is usually used when you want to edit your images after loading them from a string. Syntax: resource ima 2 min read Like