How to get the DPI of an image file (PNG)
You could use identify
from imagemagick
:
identify -format '%x,%y\n' image.png
Note however that identify
will return the resolution in PPCM
1 (pixels per centimeter) instead of PPI
(pixels per inch) so you might need to add -units PixelsPerInch
to your command.
There's also exiftool
:
exiftool -p '$XResolution,$YResolution' image.png
though it assumes the image file has those tags defined.
1: see this thread on their forum
open it with "the gimp" and click [image] -> [image properties]