Like this:
$src_image = 'path/to/image.png';
$picsize = getimagesize($src_image);
$source_x = $picsize[0];
$source_y = $picsize[1];
$dest_x = ceil($source_x / 2);
$dest_y = ceil($source_y / 2);
$source_id = imagecreatefrompng($src_image);
$target_id = imagecreatetruecolor($dest_x, $dest_y);
$target_pic = imagecopyresampled($target_id, $source_id,
0, 0, 0, 0,
$dest_x, $dest_y,
$source_x, $source_y);
header('Content-Type: image/png');
imagepng ($target_id);
That will resize an image to half-size. Whatever size you want, just substitute for the "$dest_" values.