Page 1 of 1

How convert jpg change dpi

Posted: 2020-05-06T19:48:44-07:00
by wangyongjun
dpi 96 . How can change it to 300

Re: How convert jpg change dpi

Posted: 2020-05-06T20:07:00-07:00
by snibgo
With "-density 300".

Re: How convert jpg change dpi

Posted: 2020-05-06T20:44:32-07:00
by wangyongjun
a.jpg Image size 6969*9331 dpi: 300
convert a.jpg -density 350 -resize 5973x7998 b.jpg
check b.jpg dpi still 300 . resize effected

Re: How convert jpg change dpi

Posted: 2020-05-06T21:33:17-07:00
by snibgo
What version of IM, on what platform?

Please show your exact commands.

It works fine for me, with IM v7.0.8-64 on Windows 8.1:

Code: Select all

%IMG7%magick -size 6969x9331 -density 300 -units PixelsPerInch xc: a.jpg

%IMG7%magick identify -format "%%f %%x %%y %%U\n" a.jpg

%IMG7%magick a.jpg -density 350 -resize 5973x7998 b.jpg

%IMG7%magick identify -format "%%f %%x %%y %%U\n" b.jpg
The outputs are:

Code: Select all

a.jpg 300 300 PixelsPerInch

b.jpg 350 350 PixelsPerInch

Re: How convert jpg change dpi

Posted: 2020-05-06T22:43:22-07:00
by wangyongjun
Version: ImageMagick 6.7.8-9 2019-08-08 Q16 CentOS7
There seems has no magick cmd on linux
[wangyongjun@fm-mgt-88 Image-ExifTool-11.93]$ magick identify -format "%%f %%x %%y %%U\n" ../rgb_2.jpg
-bash: magick: command not found

Re: How convert jpg change dpi

Posted: 2020-05-06T22:47:52-07:00
by wangyongjun
and I use ExifTool to check dpi(X Resolution)

Re: How convert jpg change dpi

Posted: 2020-05-06T23:34:15-07:00
by snibgo
For v6, use "convert" instead of "magick".

Your 6.7.8-9 is very very old. It may have a bug for "-density". I suggest you upgrade.

Re: How convert jpg change dpi

Posted: 2020-05-07T08:54:25-07:00
by fmw42
IM 6.7.8.9 is known to be buggy.