InfoHeap
Tech tutorials, tips, tools and more
Navigation
  • Home
  • Tutorials
    • CSS tutorials & examples
    • CSS properties
    • Javascript cookbook
    • Linux/Unix Command Line
    • Mac
    • PHP
      • PHP functions online
      • PHP regex
    • WordPress
  • Online Tools
    • Text utilities
    • Online Lint Tools
search

ImageMagick tutorials

  • Install Imagemagick on Mac
  • Install Imagemagick on Ubuntu
  • Create animated gif using Mac preview
  • Create animated gif on command line
  • Edit animated gif speed
  • Find image width and ppi
  • Find image unique colors and bit depth
  • Resize image dimention
  • Compress images
  • Crop image
 
  • Home
  • > Tutorials
  • > Linux/Unix Command Line
  • > ImageMagick

Get image width and ppi using imagemagick identify on command line

By admin on Dec 4, 2015

Imagemagick identify is pretty handy utility to get information about an image. You need to have imagemagick installed on your Mac or Linux for the purpose of this tutorial. Here are some scenarios to get image information:

Print image size (pixels) and PPI

Image size (pixels)

$ identify -format "Pixel Size: %w x %h\n"  img1.png
Pixel Size: 487 x 259

Image PPI (pixels per inch)

$ identify -format "PPI: %x x %y\n"  img1.png
PPI:72 x 72

Note: to find actual image size, you can divide pixel width by width PPI.

Print image width and height in inches

Width in inches

$ identify -format "%w/%x\n" img1.png | bc -l
6.76388888888888888888

Height in inches

$ identify -format "%h/%y\n" img1.png | bc -l
3.59722222222222222222

Suggested posts:

  1. Find image unique colors and bit depth using imagemagick identify
  2. How to crop an image using imagemagick convert
  3. Imagemagick – how to create animation on command line
  4. How to compress screenshot images using imagemagick convert
  5. How to install Imagemagick on Mac
  6. How to install Imagemagick on Ubuntu Linux
  7. How to resize image (including animated gif) using Image magick convert
  8. Get file size in bytes on Linux
Share this article: share on facebook share on linkedin tweet this submit to reddit
Posted in Tutorials | Tagged ImageMagick, Linux, Linux/Unix Command Line, Mac, Tutorials, Ubuntu Linux

Follow InfoHeap

facebook
twitter
googleplus
  • Browse site
  • Article Topics
  • Article archives
  • Recent Articles
  • Contact Us
  • Omoney
Popular Topics: AngularJS | Apache | AWS and EC2 | Bash shell scripting | Chrome developer tools | CSS | CSS cookbook | CSS properties | CSS Pseudo Classes | CSS selectors | CSS3 | CSS3 flexbox | Devops | Git | HTML | HTML5 | Java | Javascript | Javascript cookbook | Javascript DOM | jQuery | Linux | Linux/Unix Command Line | Mac | Mac Command Line | Mysql | Networking | Node.js | Online Tools | PHP | PHP cookbook | PHP Regex | Python | Python array | Python cookbook | SEO | Site Performance | SSH | Ubuntu Linux | Web Development | Webmaster | Wordpress | Wordpress customization | Wordpress How To | Wordpress Mysql Queries

Copyright © 2022 InfoHeap.

Powered by WordPress