convert image 75 dpi to 300 dpi
-
- Posts: 38
- Joined: 2010-12-14T03:56:10-07:00
- Authentication code: 8675308
convert image 75 dpi to 300 dpi
helloo i want to convert 75 dpi image into 300 dpi.
is it possible using IM.
help me in regarding this
is it possible using IM.
help me in regarding this
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: convert image 75 dpi to 300 dpi
convert image -density 300 -units pixelsperinch resultimage
see
http://www.imagemagick.org/script/comma ... ptions.php
Depending upon how you want this converted you may need to use -resample. See above
see
http://www.imagemagick.org/script/comma ... ptions.php
Depending upon how you want this converted you may need to use -resample. See above
Re: convert image 75 dpi to 300 dpi
@Fred: I think you meant "-density"..
But a different order is recommended with current IM versions (so that it works for all images):
The same with resample. If resampling to 300dpi is needed, use this:
But a different order is recommended with current IM versions (so that it works for all images):
Code: Select all
convert -units PixelsPerInch image -density 300 resultimage
Code: Select all
convert -units PixelsPerInch image -resample 300 resultimage
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: convert image 75 dpi to 300 dpi
Drarakel wrote:@Fred: I think you meant "-density"..
But a different order is recommended with current IM versions (so that it works for all images):The same with resample. If resampling to 300dpi is needed, use this:Code: Select all
convert -units PixelsPerInch image -density 300 resultimage
Code: Select all
convert -units PixelsPerInch image -resample 300 resultimage
Yes, typo. My mind is going! Thanks for correcting.
If you have a pdf input image then -density needs to be before the input image.
Drarakel,
Under what conditions do you need to have -units first other than for vector images? This is new to me. Is it a bug? Has it been reported?
Fred
Re: convert image 75 dpi to 300 dpi
No, not a bug - a feature. (Or rather: the special behaviour of the feature in "-units" that converts the density value.) But granted, not a well-documented one. I'll try to explain the small obstacles with that..fmw42 wrote:Under what conditions do you need to have -units first other than for vector images? This is new to me. Is it a bug?
As you probably know, if the input file has a density value in PixelsPerCentimeter, "-units PixelsPerInch" will change the units value, but also converts the density to the proper value. But setting the density AND unit can be a bit more problematic. Example - if you want to change a 75dpi image to the value 300dpi that way:
Code: Select all
convert rose: -set units PixelsPerInch -density 75 rose1.png
convert rose1.png -density 300 -units PixelsPerInch rose2.jpg
Now, using "-units" before the input file behaves differently:
Code: Select all
convert -units PixelsPerInch rose1.png -density 300 rose2b.jpg
Of course, there are other possibilities for simply changing both the density and unit value in current IM versions - as one can use "-set":
Code: Select all
convert rose1.png -set units PixelsPerInch -density 300 rose2c.jpg
But: With "-resample", the first recommendation is essential:
Code: Select all
convert -units PixelsPerInch rose1.png -resample 300 rose2d.jpg
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: convert image 75 dpi to 300 dpi
I do know that -density should be just a setting of the image meta-data. I would probably have expected something similar with units, in which case order between the two should not matter. However they both probably should be set after reading the image.
The problem is that density is also a 'input setting'. That is a global setting that is saved so that vector images can use the value when they are 'rasterized'. As such their use is confusing.
That is -density is being dual purposed as both a input setting for images that is created and read in, and as image meta-data modifier operator after images have been read in.
In other words it is more than likely that the two aspects are causing buggy behaviour.
ASIDE: It is for this reason that many options such as -label is strictly a input setting only, while -set label is strictly used as a meta-data attribute changing operator!
For more on this distinction see IM Examples Basics,
Image Meta-data: Attributes, Properties and Artifacts
http://www.imagemagick.org/Usage/basics/#settings
It may be time for the same separation of handling to happen to -density and -unit attributes.
The problem is that density is also a 'input setting'. That is a global setting that is saved so that vector images can use the value when they are 'rasterized'. As such their use is confusing.
That is -density is being dual purposed as both a input setting for images that is created and read in, and as image meta-data modifier operator after images have been read in.
In other words it is more than likely that the two aspects are causing buggy behaviour.
ASIDE: It is for this reason that many options such as -label is strictly a input setting only, while -set label is strictly used as a meta-data attribute changing operator!
For more on this distinction see IM Examples Basics,
Image Meta-data: Attributes, Properties and Artifacts
http://www.imagemagick.org/Usage/basics/#settings
It may be time for the same separation of handling to happen to -density and -unit attributes.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: convert image 75 dpi to 300 dpi
Just an FYI (and possibly a BUG), none of this dpi stuff works with EXR images. Yes, openEXR assures me that it supports dpi.
Have any of you tried changing the dpi of an EXR image? If you've successfully done it. I would love to see that convert call.
Thanks.
- Jimbo
Have any of you tried changing the dpi of an EXR image? If you've successfully done it. I would love to see that convert call.
Thanks.
- Jimbo
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: convert image 75 dpi to 300 dpi
Yes, typo. Thanks for catching it. I have corrected my post.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: convert image 75 dpi to 300 dpi
You can request an enhancement on this the developers forum. But there is no guaranteed response time as the developers are very busy.Jimbo wrote: ↑2019-08-26T18:41:13-07:00 Just an FYI (and possibly a BUG), none of this dpi stuff works with EXR images. Yes, openEXR assures me that it supports dpi.
Have any of you tried changing the dpi of an EXR image? If you've successfully done it. I would love to see that convert call.
Thanks.
- Jimbo
It might need a new updated to the OpenEXR interface with Imagemagick such as a new define.
I do not see anything about density for EXR in their documentation at https://www.openexr.com/documentation/R ... eFiles.pdf