ImageMagick

# Resize image
convert -resize 50% -quality 80 input.jpg output.jpg
 
# Convert color to gray
convert <input> -colorspace Gray <output>
convert <input> -type Grayscale <output>
 
mogrify -verbose -resize 50% -quality 80% *.jpg

2.mogrify -path Image-Small/ -resize 800x600 -density 25x25 *.gif This command will resize all images ending with .gif to 800x600 with density 25x25. The resized images will be saved in Image-Small directory. So the original files is unmodified.