GIMP
   compress
   resize
   batch

ImageMagick
   list formats:
      convert -list format
   convert JPG to PNG:
      convert input.jpg output.png
   convert all JPGs to PNGs: 
      mogrify -format png *.jpg
   convert SVG to PNG at 1000 DPI:
      convert -density 1000 -units PixelsPerInch input.svg output.png
   compress JPG to quality 50% width 1000:
      convert input.jpg -quality 50% -resize 1000 output.jpg
   compress all JPGs to quality 50% width 1000:
      mogrify -quality 50% -resize 1000 *.jpg