Hello,
I have image with resolution 600x600 (inches) with image width 2899 and image lenght 2081. Because of the next processes, where the system accepts only image with resolution of 300x300 i have to resample the original image. I know i can do it with two commands:
convert -units PixelsPerInch image -density 300 resultimage
convert image -resample 300x300 resultimage
I understand the command with resample, the resulted image has resolution 300 and image width and length in pixels are half of the original image.
But i the first command i am not sure wht it does, it changes the resolution but the image width and lenght is the same, i am not sure how to undertand this, what it does with the image.
Which command should i use if the only thing i want to change is the resolution just to pass it through the system, otherwise i want the image to be unchanged, as original image.
I tried to google it, but cant understand it fully.
Edit: The density option, if i understand it well, is said just to change the value of the tag not the real resolution, so the resolution is still 600 while the image metadata says it is 300? So what is better? What preserve image in better quality?
Changing resolution with -resample or -units density
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Changing resolution with -resample or -units density
If you multiply the density by the width and height in pixels, then you get the print size in inches. So it depends upon what print size you want. The use of -resample will preserve the print size in inches because it changes the width and height in pixels according to the change in density to match the print size. The use of just -density with make the print size change because you are changing the density but not the width and height in pixels.