Photo from Digital Camera Always Saves at 72 Density

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
markurxn

Photo from Digital Camera Always Saves at 72 Density

Post by markurxn »

I'm trying to save a photo at 300 density. I'm using the command

convert -density 300 photo.jpg -resize 150x122 photo.png

but the photo is always saved at 72 dpi. If I open this photo in photoshop, save as another name without any other file modifications and rerun the command above, the resized png has a 300 dpi.

What gives?

Image
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Photo from Digital Camera Always Saves at 72 Density

Post by fmw42 »

try

convert photo.jpg -resize 150x122 -density 300 photo.png


Note: your input resolution is 180 not 72

convert dinkey38.jpg -verbose info:
Image: dinkey38.jpg
Format: JPEG (Joint Photographic Experts Group JFIF format)
Class: DirectClass
Geometry: 2048x1536+0+0
Resolution: 180x180
Print size: 11.3778x8.53333
Units: PixelsPerInch


If I do:
convert dinkey38.jpg -resize 150x122 -density 300 tmp.png

then afterwards the resolution is 300

convert tmp.png -verbose info:
Image: tmp.png
Format: PNG (Portable Network Graphics)
Class: DirectClass
Geometry: 150x113+0+0
Resolution: 300x300
Print size: 0.5x0.376667
Units: PixelsPerInch
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Photo from Digital Camera Always Saves at 72 Density

Post by anthony »

Note IM saves and used the correct JPEG density setting.

Photoshop however does not, it saves and uses a density setting in one of its special profiles, and not the default JPEG settings. You will need to strip that profile from the image before photoshop will use the proper default JPEG density information.

Arrrggghhhh....... (do you have any hair left!)
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply