Retaining original DPI in convert command.

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
rethna2
Posts: 1
Joined: 2013-06-25T02:44:22-07:00
Authentication code: 6789

Retaining original DPI in convert command.

Post by rethna2 »

I am converting my image to grayscale using :

Code: Select all

convert test.jpg -recolor '0.2225 0.7169 0.0606 0.2225 0.7169 0.0606 0.2225 0.7169 0.0606' grayscale.jpg
Though my image is 96dpi or 300dpi, my converted image is always 72dpi. How to retain the original dpi.

I don't know beforehand the dpi of the incoming image. (it varies from 72 to 300dpi).

Somebody pls help. :)
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Retaining original DPI in convert command.

Post by snibgo »

What version IM are you using, and what platform?

For v6.8.6-0 on Windows, your command retains the resolution.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Retaining original DPI in convert command.

Post by fmw42 »

Though my image is 96dpi or 300dpi, my converted image is always 72dpi. How to retain the original dpi.
What tool is saying your density is 72dpi? Is it IM identify -verbose yourimage? Or something else? Also how do you know your input image density is 96dpi or 300dpi?
Post Reply