imageinterlace

(PHP 4, PHP 5, PHP 7)
Enable or disable interlace
int imageinterlace ( resource $image [, int $interlace = 0 ] )

imageinterlace() turns the interlace bit on or off.

If the interlace bit is set and the image is used as a JPEG image, the image is created as a progressive JPEG.

Parameters:
image

An image resource, returned by one of the image creation functions, such as imagecreatetruecolor().

interlace

If non-zero, the image will be interlaced, else the interlace bit is turned off.

Returns:

Returns 1 if the interlace bit is set for the image, 0 otherwise.

Examples:
Turn on interlacing using imageinterlace()
1
2
3
4
5
6
7
8
9
10
11
<?php
// Create an image instance
$im = imagecreatefromgif('php.gif');
 
// Enable interlancing
imageinterlace($im, true);
 
// Save the interlaced image
imagegif($im'./php_interlaced.gif');
imagedestroy($im);
?>
doc_php
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.