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.

Add filename, date and time at the bottom of image

REM ##########################################################
REM Make a copy of the original image and then add filename, date and time at the bottom of the copy(*%suffix%).
REM This script was created because I need to know the filename of the printed image.
REM It requires convert.exe and identify.exe.
REM ##########################################################
SET imgExt=jpg
SET suffix=.tx1.%imgExt%
 
del /q *%suffix%
 
FOR /F "delims=" %%i IN ('dir /b *.%imgExt%') DO (CALL :addlabel "%%i")
GOTO EOF
 
:addlabel
SET filename=%1
 
identify -format "%%[fx:w]x" %filename% > imginfo.txt
FOR /F "delims=\\n" %%i IN ('type imginfo.txt') DO (SET imgsize=%%i)
del /q imginfo.txt
 
SET fwnoq=%filename:"=%
convert %1 -background white  -fill black -size %imgsize% -pointsize 10 caption:"%fwnoq% - %date% - %time%" -append "%fwnoq%%suffix%"
 
SET imgsize=
SET filename=
 
:EOF

Take screenshot from command line on an X server

import is part of ImageMagick package.

#import the "root" window - that is, the entire screen.
import -window root filename.png
 
import -window root screenshot-$(date +%Y-%m-%d_%k.%M.%S).png

Note: Import will not work on MS Windows.