Page 1 of 1

Dpi of png is not changing with imagemagick c++ api.

Posted: 2015-10-09T05:42:46-07:00
by deepakd
Hi,

I have used density(dpi) api to change the dpi of png image. dpi is not getting changed for PNG image but it works fine for JPEG image.
Please let us know whether anything I need to before or after calling density(dpi).


Thanks,
Deepak

Re: Dpi of png is not changing with imagemagick c++ api.

Posted: 2015-10-09T08:05:19-07:00
by dlemstra
What is your ImageMagick version and operating system?

Re: Dpi of png is not changing with imagemagick c++ api.

Posted: 2015-10-11T22:11:19-07:00
by deepakd
Hi,
My imagemagick version is -6.8.9-Q16 and OS is Windows 7 64.

Thanks,
Deepak

Re: Dpi of png is not changing with imagemagick c++ api.

Posted: 2015-10-13T05:54:43-07:00
by deepakd
Hi All,

could anyone help on this?


Thanks,
Deepak

Re: Dpi of png is not changing with imagemagick c++ api.

Posted: 2015-10-13T09:22:05-07:00
by fmw42
deepakd wrote:Hi,

I have used density(dpi) api to change the dpi of png image. dpi is not getting changed for PNG image but it works fine for JPEG image.
Please let us know whether anything I need to before or after calling density(dpi).


Thanks,
Deepak

Did you specify the units as well? IM will automatically convert dpi to dpc if proper units are specified, since png only uses dots per centimeter.

Re: Dpi of png is not changing with imagemagick c++ api.

Posted: 2015-10-13T22:52:18-07:00
by deepakd
>Did you specify the units as well? IM will automatically convert dpi to dpc if proper units are specified, since png only uses dots per centimeter.[/quote]
Hi,

We are not specifying any units. We are just giving (150,150) and DPI is not getting changed. output dpi is same as input dpi.

if(dpi.length() != 0){
const Magick::Geometry gm(boost::lexical_cast<size_t>(dpi),boost::lexical_cast<size_t>(dpi));
image.density(gm);


Thanks,
Deepak

Re: Dpi of png is not changing with imagemagick c++ api.

Posted: 2015-10-13T23:00:36-07:00
by fmw42
try specifying the units as well. See if that makes any difference.

Re: Dpi of png is not changing with imagemagick c++ api.

Posted: 2015-10-14T02:04:32-07:00
by deepakd
Hi,

We tried giving units.
-----------------------------------------------------------------------------------------------------------
if(dpi.length() != 0){
const Magick::Geometry gm("150 cm,391 cm"); // Specified in cms
image.density(gm);

}
-----------------------------------------------------------------------------------------------------------
Still we are getting const dpi(96) always for png image. Please let us know whether the specifying units is proper or not. Providing code snippet helps much.


Thanks,
Deepak

Re: Dpi of png is not changing with imagemagick c++ api.

Posted: 2015-10-14T03:21:51-07:00
by deepakd
fmw42 wrote:try specifying the units as well. See if that makes any difference.
Hi,

We tried giving units.
-----------------------------------------------------------------------------------------------------------
if(dpi.length() != 0){
const Magick::Geometry gm("150 cm,391 cm"); // Specified in cms
image.density(gm);

}
-----------------------------------------------------------------------------------------------------------
Still we are getting const dpi(96) always for png image. Please let us know whether the specifying units is proper or not. Providing code snippet helps much.


Thanks,
Deepak

Re: Dpi of png is not changing with imagemagick c++ api.

Posted: 2015-10-14T09:27:36-07:00
by fmw42
One of the IM developers will need to check this out further.

Re: Dpi of png is not changing with imagemagick c++ api.

Posted: 2015-10-14T10:30:07-07:00
by deepakd
HI,
fmw42 wrote:One of the IM developers will need to check this out further.
Thank you for the reply. Will wait for the developer reply as I am not getting information from any source to solve this issue.

Thanks,
Deepak

Re: Dpi of png is not changing with imagemagick c++ api.

Posted: 2015-10-14T10:58:45-07:00
by fmw42
You could post this issue on the Bugs forum.

Re: Dpi of png is not changing with imagemagick c++ api.

Posted: 2015-10-20T05:23:46-07:00
by deepakd
Able to see change in dpi using irfan viewer.