<?php
bool imagesettile ( GdImage $image, GdImage $tile )
where,
$image = The image identifier
$tile = The image identifier to be used as a tile
?>
<?php
echo 'PHP VERSION: ' . PHP_VERSION . '<br><br>';
$base_img = 'jpeg/JPEG 032 01.jpg';
$tile_img = 'png/PNG 072 01.png';
$dest_img = 'jpeg/JPEG 032 01 imagesettile.jpg';
echo $tile_img; ?><br><br>Tile Image<br><br>
<img src="<?php echo $tile_img; ?>"
alt="<?php echo $tile_img; ?>"
title="<?php echo $tile_img; ?>" width="20"> <br><br>
<?php echo $base_img; ?><br><br>Base image<br><br>
<img src="<?php echo $base_img; ?>"
alt="<?php echo $base_img; ?>"
title="<?php echo $base_img; ?>" width="400"><br><br><br>
<?php
$id_base = imagecreatefromjpeg($base_img);
$id_tile = imagecreatefrompng($tile_img);
imagesettile($id_base, $id_tile);
$from_x = 0;
$from_y = 0;
$to_x = imagesx($id_base) - 1;
$to_y = imagesy($id_base) - 1;
imagefilledrectangle($id_base,
$from_x,
$from_y,
$to_x,
$to_y,
IMG_COLOR_TILED);
imagejpeg($id_base, $dest_img, 90);
echo $dest_img; ?><br><br>Tiled Image<br><br>
<img src="<?php echo $dest_img; ?>"
alt="<?php echo $dest_img; ?>"
title="<?php echo $dest_img; ?>" width="400"><br><br>