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

Magick++ is an object-oriented C++ interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick++.
Post Reply
deepakd
Posts: 15
Joined: 2015-10-08T22:55:09-07:00
Authentication code: 1151

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

Post 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
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

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

Post by dlemstra »

What is your ImageMagick version and operating system?
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
deepakd
Posts: 15
Joined: 2015-10-08T22:55:09-07:00
Authentication code: 1151

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

Post by deepakd »

Hi,
My imagemagick version is -6.8.9-Q16 and OS is Windows 7 64.

Thanks,
Deepak
deepakd
Posts: 15
Joined: 2015-10-08T22:55:09-07:00
Authentication code: 1151

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

Post by deepakd »

Hi All,

could anyone help on this?


Thanks,
Deepak
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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.
deepakd
Posts: 15
Joined: 2015-10-08T22:55:09-07:00
Authentication code: 1151

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

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post by fmw42 »

try specifying the units as well. See if that makes any difference.
deepakd
Posts: 15
Joined: 2015-10-08T22:55:09-07:00
Authentication code: 1151

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

Post 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
deepakd
Posts: 15
Joined: 2015-10-08T22:55:09-07:00
Authentication code: 1151

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

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post by fmw42 »

One of the IM developers will need to check this out further.
deepakd
Posts: 15
Joined: 2015-10-08T22:55:09-07:00
Authentication code: 1151

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

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post by fmw42 »

You could post this issue on the Bugs forum.
deepakd
Posts: 15
Joined: 2015-10-08T22:55:09-07:00
Authentication code: 1151

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

Post by deepakd »

Able to see change in dpi using irfan viewer.
Post Reply