PHP | imageinterlace() Function Last Updated : 30 Jan, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report The imageinterlace() function is an inbuilt function in PHP which is used to enable or disable interlace in an image. Interlacing (also known as interleaving) is a method of encoding a bitmap image such that a person who has partially received it sees a degraded copy of the entire image. One difference between interlaced and non-interlaced images on a website is that the former one is loaded in a low-quality version first and then it's quality keeps improving as the website loads whereas a non-interlaced image is loaded in a fixed quality line by line from top to bottom when the website loads. Syntax: int imageinterlace( resource $image, int $interlace ) Parameters: This function accepts two parameters as mentioned above and described below: $image: It specifies the image to be interlaced. $interlace: It specifies whether to enable or disable interlacing. Return Value: This function returns 1 if the interlace bit is set for the image, otherwise 0. Below examples illustrate the imageinterlace() function in PHP: Program 1: In this example we will enable interlacing. php <?php // Create an image from URL $im = imagecreatefrompng( 'https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-13.png'); // Enable interlacing imageinterlace($im, 1); // View the output header('Content-type: image/jpeg'); imagejpeg($im); imagedestroy($im); ?> Output: Program 2: In this example we will disable interlacing. php <?php // Create an image from URL $im = imagecreatefrompng( 'https://media.geeksforgeeks.org/wp-content/uploads/geeksforgeeks-13.png'); // Disable interlacing imageinterlace($im, 0); // View the output header('Content-type: image/jpeg'); imagejpeg($im); imagedestroy($im); ?> Output: Reference: https://www.php.net/manual/en/function.imageinterlace.php Comment More infoAdvertise with us Next Article PHP | imagefill() Function G gurrrung Follow Improve Article Tags : Web Technologies PHP PHP-function Similar Reads PHP | imagesetinterpolation() Function The imagesetinterpolation() function is an inbuilt function in PHP which is used to set the interpolation method, setting an interpolation method affects the rendering of various functions such as the imagerotate() function.Syntax:Â Â bool imagesetinterpolation( resource $image, int $method )Parameter 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 | 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 | imagesettile() Function The imagesettile() function is an inbuilt function in PHP which is used to set the tile image for filling the area. Syntax: bool imagesettile( $image, $tile ) Parameters: This function accepts two parameters as mentioned above and described below: $image: It is returned by one of the image creation 2 min read PHP | imagesettile() Function The imagesettile() function is an inbuilt function in PHP which is used to set the tile image for filling the area. Syntax: bool imagesettile( $image, $tile ) Parameters: This function accepts two parameters as mentioned above and described below: $image: It is returned by one of the image creation 2 min read PHP | imagepng() Function The imagepng() function is an inbuilt function in PHP which is used to display image to browser or file. The main use of this function is to view an image in the browser, convert any other image type to PNG and applying filters to the image. Syntax: bool imagepng( resource $image, int $to, int $qual 2 min read Like