Sometimes I have image files which I want to contain a certain DPI setting. Note that I mean just the DPI value, i.e. just the value in the image's metadata. I don't want to resize the actual image. So for example a higher DPI would result in a smaller size in centimeters, and the same amount of pixels.
I know I can set or change an image's DPI using ImageMagick convert
with the -density
parameter, but this will re-encode the image. I want to avoid that.
Is there a way, with ImageMagick or something else (e.g. ExifTool or something) to explicitly set a JPEG's DPI value without changing the actual compressed image contents itself?
Note that I'm using OS X and looking for a command line tool to do this (I want to use it in shell scripts).