views:

266

answers:

1

Hi All,

I want to change the resolution of the image from 72 to 25 dpi using PHP?

is it possible?

Regards,

Salil Gaikwad

+2  A: 

It's not possible (at least with PHP/GD, not sure about ImageMagik), sorry.

However you can try mimicking it, lets say you want to create a 400x300 25 dpi image, here is the math:

WIDTH

72 -------- 400
25 -------- w = (25 * 400) / 72 (=) w ~= 139 pixels

HEIGHT

72 -------- 300
25 -------- h = (25 * 300) / 72 (=) h ~= 104 pixels

You create a new 139x104 72 dpi image, work with it and after you're done resize it to 400x300 pixels.

Alix Axel
hey i have done it by using imagick
Salil
and how did you solve it, by using above calculations or other a way?
Ramon