To convert an image to a different resolution you need ImageMagick.
$img = new Imagick($imgname);
if ($img) {
$width=$img->getImageWidth();
$height=$img->getImageHeight();
$res=$img->getImageResolution();
$colorspace=$img->getImageColorspace();
$resx=$res['x'];
$resy=$res['y'];
echo 'Image is '.$width.'x'.$height.' resolution: '.$resx.'x'.$resy.' colorspace='.$colorspace.'='.$colorspace_array[$colorspace];
$cmw=($width/$resx)*2.54;
$cmh=($height/$resy)*2.54;
echo 'Image is '.$cmw.'cm x '.$cmh.'cm';
// creating 72dpi version
$w72=round($width*72/$resx);
$h72=round($height*72/$resy);
if ($w72>$width || $h72>$height) {
$w72=$width;
$h72=$height;
}
$img->resizeImage($w72,$h72,imagick::FILTER_QUADRATIC,1);
$img->writeImage('newimage.png');
} else {
die('Unknown image format');
}