Я нашел ошибку ($ image1 должен быть $ output_image)
<?php
$image_path = 'test.png';
$input_image = imagecreatefrompng($image_path);
$image_info = getimagesize($image_path);
$output_image = imagecreatetruecolor($image_info[0], $image_info[1] * 2);
imagecopy ($output_image, $input_image, 0, 0, 0, 0, $image_info[0], $image_info[1]);
if($output_image && imagefilter($output_image , IMG_FILTER_GRAYSCALE)) {
echo 'Image converted.';
imagecopy ($output_image, $input_image, 0, $image_info[1], 0, 0, $image_info[0], $image_info[1]);
imagepng($output_image, 'test.png');
} else {
echo 'Conversion failed.';
}
imagedestroy($input_image);
imagedestroy($output_image);
?>