Reduce page size without "losing quality" (increase dpi)

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
DreamFlasher
Posts: 3
Joined: 2016-02-11T15:55:08-07:00
Authentication code: 1151

Reduce page size without "losing quality" (increase dpi)

Post by DreamFlasher »

Hi,
I tried to read the manual and search the forum first to achieve what I am aiming at, I have the impression it should be trivial but I don't get it. I'd appreciate your help and sorry for the trivial question.

Input image: 3672 x 4869 px, 72 dpi
Desired output: height 297.302 mm (a4), and the corresponding dpi value so that I don't lose more information that what is necessary (which is approximately 420 dpi)

Bonus question: I also would like to rotate left in the same step, do I do this better before or after the resize?

Thank you,
Marcel
ImageMagick version: Latest, platform: Windows, API: Command line
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Reduce page size without "losing quality" (increase dpi)

Post by fmw42 »

Please, always provide your IM version and platform when asking questions, since syntax may differ. Also provide your exact command line and if possible your images,

See viewtopic.php?f=1&t=9620

Note that IM works with pixels and not mm. So you need to resize to the pixel dimensions that you want and then set the density you want. You can rotate afterwards, since by then the image will be smaller.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Reduce page size without "losing quality" (increase dpi)

Post by snibgo »

The basic answer is to use "-density 416 units PixelsPerInch" or whatever value you want.
snibgo's IM pages: im.snibgo.com
DreamFlasher
Posts: 3
Joined: 2016-02-11T15:55:08-07:00
Authentication code: 1151

Re: Reduce page size without "losing quality" (increase dpi)

Post by DreamFlasher »

Thank you fmw42 and snibgo! With your hint fmw42 I came up with what snibgo wrote, so thank you both of you :)
My final code:

Code: Select all

mogrify -rotate "-90" -density "420" *.jpg
ImageMagick version: Latest, platform: Windows, API: Command line
Post Reply