Hi,
I´m converting an image doing the rotation of it. But when i´ve got an image with (200X252) in 96 DPI when doing the rotation (-rotate 90) the image stay with 252X200 but with 72 DPI. The image is a JPEG.
Any ideas how can i keep the same DPI for the image, but can´t do the set of the DPI directly (-density 76) because there are several images with several dimensions.
For example i´ve got an image with 300 DPI and when i do the rotation the image keep the 300 DPI, and i don´t know why.
Cheers,
Nuno Ferreira
Image DPI
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Image DPI
Post a link to the image that does not maintain the density? What is your IM version and platform? What version of libjpeg are you using?
Re: Image DPI
Hi,
Here is the image :
The version of the IM is : ImageMagick-6.8.6-Q16 (windows)
Cheers,
Here is the image :
The version of the IM is : ImageMagick-6.8.6-Q16 (windows)
Cheers,
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Image DPI
According to IM verbose information, the image has no units defined and no specified density (resolution). EXIFtool says the resolution is 1.
So your input image in this case is not seen to have any proper density defined and thus the output after rotation will be the same.
Whatever tool you are using to look at the density is interpreting it as a default of 72 dpi when actually there is no dpi defined.
If you want the output to have some density, then you can add -units and -density before the output to make it conform.
Alternately, you can check the density (resolution) before processing each image and if there is none, then add the density (and units) you want.
see %x and %y string formats at http://www.imagemagick.org/script/escape.php
So your input image in this case is not seen to have any proper density defined and thus the output after rotation will be the same.
Whatever tool you are using to look at the density is interpreting it as a default of 72 dpi when actually there is no dpi defined.
If you want the output to have some density, then you can add -units and -density before the output to make it conform.
Alternately, you can check the density (resolution) before processing each image and if there is none, then add the density (and units) you want.
see %x and %y string formats at http://www.imagemagick.org/script/escape.php
Re: Image DPI
Hi,
I will try to look at the info of the original image and put the information to the new image.
Cheers,
Nuno Ferreira
I will try to look at the info of the original image and put the information to the new image.
Cheers,
Nuno Ferreira