Skip to content

Latest commit

 

History

History
21 lines (17 loc) · 420 Bytes

interlacing_image.md

File metadata and controls

21 lines (17 loc) · 420 Bytes

Interlacing image

function interlace (&$image) {
    $imagex = imagesx($image);
    $imagey = imagesy($image);
    GLOBAL $black;

    for ($y = 1; $y < $imagey; $y += 2) {
        imageline($image, 0, $y, $imagex, $y, $black);
    }
}

$image = imagecreatefrompng("space.png");
$black = imagecolorallocate($image, 0, 0, 0);
interlace($image);

header("image/png");
imagepng($image);
imagedestroy($image);