I am trying to filter/render image to grayscale. But I'm having trouble on saving the output file on directory. Please see my code below:
$img_source = '/path/test.jpg';
$img = imagecreatefromjpeg($img_source);
$img_height = imagesy($img);
$img_width = imagesx($img);
$target_path = '/path/test_grayscale.jpg';
// some code for grayscale process
imagejpeg($img, $target_path);