To do this, you need to decode, crop and re-encode the image. In PHP, you can use the GD library to do this, e.g.:
# load source image and get its size
$img = imagecreatefromgif( $image_file_name );
$width = imagesx( $img );
$height = imagesy( $img );
# create a copy showing only the top half of the image
$cropped = imagecreate( $width, $height / 2 );
imagecopy( $cropped, $img, 0,0, 0,0, $width, $height/2 );
# output image in GIF format emdebbed on the page
# XXX: GD doesn't seem to support output to string directly, but we can hack it
ob_start(); imagegif( $cropped ); $gif = ob_get_clean();
echo '<img src="data:image/gif;base64,', base64_encode( $gif ), '">';
# free the image objects once they're no longer needed
imagedestroy( $img );
imagedestroy( $cropped );