Page 2 of 2

Re: Problems with -density if -unit PixelsPerInch not specificied before input image

Posted: 2018-08-16T10:35:02-07:00
by fmw42
I will just add a note.

Imagemagick processing is not done in the same order as typical Unix commands. Although IM 6 is forgiving in many ways, IM 7 is very strict in the order of things in the command line.

See

https://www.imagemagick.org/Usage/basics/#cmdline

and the following sections about order of the command line.

Re: Problems with -density if -unit PixelsPerInch not specificied before input image

Posted: 2018-08-17T03:39:38-07:00
by vartlok
I want to convert image to new image with resolution 350 and unit PixelsPerInch, but IM's converting resolution 350 -> 889 and update unit.

Re: Problems with -density if -unit PixelsPerInch not specificied before input image

Posted: 2018-08-17T05:21:22-07:00
by snibgo
Your correct command does exactly that, for me using IM v7.0.8-10:

Code: Select all

C:\www\im>%IM%magick source.jpg -units PixelsPerInch -density 350 out.jpg

C:\www\im>%IM%magick identify -verbose out.jpg
Image: out.jpg
  Format: JPEG (Joint Photographic Experts Group JFIF format)
  Mime type: image/jpeg
  Class: DirectClass
  Geometry: 562x360+0+0
  Resolution: 350x350
  Print size: 1.60571x1.02857
  Units: PixelsPerInch

Re: Problems with -density if -unit PixelsPerInch not specificied before input image

Posted: 2018-08-17T07:53:08-07:00
by vartlok
Ah, my bad. I'm using imagemagick/7.0.8-10/bin/convert instead of imagemagick/7.0.8-10/bin/magic