<?php
// 画像のインスタンスを作成します
$src = imagecreatefromgif('php.gif');
$dest = imagecreatetruecolor(80, 40);
// コピーします
imagecopy($dest, $src, 0, 0, 20, 13, 80, 40);
// 出力してメモリから解放します
header('Content-Type: image/gif');
imagegif($dest);
imagedestroy($dest);
imagedestroy($src);
?>