LukeShortCloud / rootpages

Root Pages is a collection of easy-to-reference tutorials and guides primarily for Linux and other UNIX-like systems.
Other
56 stars 6 forks source link

[administration][graphics] Explain picture density #770

Open LukeShortCloud opened 2 years ago

LukeShortCloud commented 2 years ago

JPEG (*.jpg) stores the density of an image as pixels per inch (PPI). PNG (*.png) stores the density of an image as pixels per centimeter (PPC). The example below shows two images with the same PPI (just measured in different units).

$ identify -verbose <IMAGE>.jpg | grep -P -i "resolution|units"
  Resolution: 600x600
  Units: PixelsPerInch
$ identify -verbose <IMAGE>.png | grep -P -i "resolution|units"
  Resolution: 236.22x236.22
  Units: PixelsPerCentimeter

https://apple.stackexchange.com/questions/388933/using-imagemagicks-identify-to-determine-dpi-of-a-document

LukeShortCloud commented 2 years ago

Dots per inch (DPI) == Pixels per inch (PPI) Dots per inch (DPI) != Pixel per centimeter (PPC)

LukeShortCloud commented 2 years ago

Convert PPI:

convert -units PixelsPerInch -density <PPI> <IMAGE_SOURCE> <IMAGE_DESTINATION>

https://legacy.imagemagick.org/discourse-server/viewtopic.php?t=18241