PHP GD set PNG image resolution with decimal

29 Views Asked by At

We do lenticular printing and usually the resolution of the image we work with will have a decimal point. For example,

$file_name = "example.png";
$resolution = 400.85;
imageresolution($image, $resolution);  
imagepng($image, **DIR** . '/'. $file_name, -1, -1);

When I open example.png in Photoshop the resolution is 401 instead of 400.85. Just this little discrepency can affect the visual effect of a lenticular print. Please help!

0

There are 0 best solutions below