[FIXED] Batch changing resolution in PNG

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Mazin
Posts: 10
Joined: 2008-11-24T13:30:50-07:00

[FIXED] Batch changing resolution in PNG

Post by Mazin »

I'm trying to change the resolutions of a batch of PNG files. Right now, they are at 72dpi, but they need to be set to 300dpi (no rescaling). This is because the dpi is used when I convert them into PDF, resulting in incorrect PDF page sizes.

I try

Code: Select all

mogrify -density 300x300 page*.png
but nothing changes. The only way I can change them is to go into GIMP and manually set the resolution (Print Size option) one-by-one.

Any suggestions?
Last edited by Mazin on 2008-11-24T14:47:07-07:00, edited 1 time in total.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Batch changing resolution in PNG

Post by fmw42 »

Mazin wrote:I'm trying to change the resolutions of a batch of PNG files. Right now, they are at 72dpi, but they need to be set to 300dpi (no rescaling). This is because the dpi is used when I convert them into PDF, resulting in incorrect PDF page sizes.

I try

Code: Select all

mogrify -density 300x300 page*.png
but nothing changes. The only way I can change them is to go into GIMP and manually set the resolution (Print Size option) one-by-one.

Any suggestions?

I don't know if you can use page*.png, I think you have to use just *.png

see http://www.imagemagick.org/Usage/basics/#mogrify for more details on mogrify and using directories to protect your files (or make backups) as mogrify can be dangerous.
Mazin
Posts: 10
Joined: 2008-11-24T13:30:50-07:00

Re: Batch changing resolution in PNG

Post by Mazin »

Erm, I meant that in this particular case, my files are named page00.png, page01.png, etc.

I understand the implications of using mogrify, and it is clearly modifying my files when I run the command. It just isn't setting the resolution.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Batch changing resolution in PNG

Post by magick »

We have a patch for the problem you reported. A fix will be available in the next point release of ImageMagick available sometime tomorrow. Thanks.
Post Reply