Imagemagick

From miki
Revision as of 12:23, 16 December 2015 by Mip (talk | contribs)
Jump to navigation Jump to search

Howto

Image resize

convert front.jpg -resize 500x500 folder.jpg

Get image info

convert -format "%f %w %h" sand.jpg info:
identify -format "%f %w %h" sand.jpg                                  # Same but shorter
identify sand.jpg -format "%f %w %h"                                  # WRONG - format string must come before because params are processed sequentially
read -r file width height <<< $(identify -format "%f %w %h" sand.jpg)  # Set values in variables