How to ImageMagick
sudo apt-get install imagemagick
# Show colors used in image
identify -verbose image.gif
# Replace color #000 with #fff
convert image.gif -fill "#fff" -opaque "#000" image2.gif
#!/bin/sh
mkdir small
for f in `find . -maxdepth 1 -type f -name "*.JPG"` ; do
filename=$(basename $f)
convert $filename -resize 2000x small/$filename
done
# mogrify -path small -define jpeg:extent=2MB *