Page 1 of 1

PNG Image 72 DPI to 300 DPI convertion

Posted: 2013-03-19T09:39:28-07:00
by srisakthikrishnan
Hi
I have PNG images of dimension 3600 X 3600 with 72 DPI and transparent background . I'm trying to change the DPI to 300. I tried below commands but its not working at all

convert Img1.png -strip -units "PixelsPerCentimeter" -density 300 Img2.png
convert Img1.png -resample 300 Img2.png

I tried my best but not able to find any solution. The same command is working fine if I convert the image form PNG to JPG or some other format.
can any one please help me with this.

Re: PNG Image 72 DPI to 300 DPI convertion

Posted: 2013-03-19T12:14:42-07:00
by fmw42
PNG does not support units of pixels-per-inch. IM will automatically convert it to the corresponding pixels-per-centimeter. Note 2.54cm per inch is the conversion.

You have told it in the first command to convert to 300 dots per centimeter. DPI is dots per inch

Re: PNG Image 72 DPI to 300 DPI convertion

Posted: 2013-03-26T04:07:44-07:00
by srisakthikrishnan
Thanks.
I changed my command as convert "D:\1.png" -units "PixelsPerCentimeter" -strip -density 118.12 "D:\2.png" .
This works fine in my local system(Windows 7 64 bit ) but not in Win Server 2003. I'm using ImageMagick-6.4.1-Q16 both in local and server.

I'm invoking the command from ASP.Net page.When I tried the command in server I'm not getting any error messages but its working fine when invoked from local system using Visual Studio.

Re: PNG Image 72 DPI to 300 DPI convertion

Posted: 2013-03-26T10:59:44-07:00
by fmw42
Perhaps differences in IM versions. 6.4 is very ancient. IM is not at 6.8 so about 400 versions old