Is it possible to change an image resolution expressed in pixels per inch (PPI) in batch mode, using command line?
My images resolution is currently below 100 PPI.
I would like to enhance it to 300 PPI.
I am preparing a document for self publish.
The agency says that the images PPI should be 300.
1 Answer
Hello and welcome to Ubuntu.SE!
Here is a proposal using ImageMagick
You can use ImageMagick for that task:
Example
Here is a 40x30 pixels original image (file size of 1367 bytes) with a resolution of 72 PPI (in both X and Y directions):
You can change its resolution using the following command:
convert -units PixelsPerInch my_original_image.jpg -density 300 my_new_image.jpgThis is the result of the previous command:
X Resolution 300 PPIY Resolution 300 PPIImage Size 40x30 pixelsFile Size 981 bytes
Or if you need resampling:
convert -units PixelsPerInch my_original_image.jpg -resample 300 my_new_image.jpgWhich gives:
X Resolution 300 PPIY Resolution 300 PPIImage Size 167x125 pxFile Size 7.7 kB
Don't hesitate to open these images with Gimp for example to see the differences.