To convert a single image 'image.jpg' to a grayscale version 'image-bw.jpg':
convert image.jpg -colorspace Gray image-bw.jpg
To convert an entire directory in images to grayscale:
mkdir bw && for i in *.jpg; do convert $i -colorspace Gray bw/$i; done
The grayscale images will be placed in a subdirectory named 'bw'. To convert something other than JPEGs, just change *.jpg to the appropriate file extension. For more information, see here.
Loading...
Loading...
© 2007–2010 David A Roberts. Valid XHTML & CSS. Entries (RSS) & Comments (RSS). Source code.