Convert

From Attie's Wiki
Revision as of 19:08, 3 October 2012 by Attie (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Image modification on the command line.

Geometry

Format Meaning
scale% Scale the image, by x percent
scale-x%xscale-y% Height and width are scaled individually by x / y percent
width Height automatically adjusts to maintain aspect ratio
xheight Width automatically adjusts to maintain aspect ratio
widthxheight Scale to fit in the box widthxheight, maintains aspect ratio
widthxheight^ Scale to used box widthxheight as minimum sizes, maintains aspect ratio
widthxheight! Resize to widthxheight, aspect ratio ignored
widthxheight> Shrinks images larger than widthxheight, to this size
widthxheight< Enlarges images smaller than widthxheight, to this size
widthxheight{+-}offset-x{+-}offset-y For example, used with -crop to specify a region to keep

Resize

convert ${FILE_IN} -resize ${WIDTH}x${HEIGHT} ${FILE_OUT}

Crop

convert ${FILE_IN} -resize ${WIDTH}x${HEIGHT}+${OFFSET_X}+${OFFSET_Y} ${FILE_OUT}
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox