April 14, 2013

[SOLVED] Convert ogv to gif

First install this:

sudo apt-get install imagemagick mplayer gtk-recordmydesktop

On a terminal:

mplayer -ao null <video file name> -vo jpeg:outdir=output

Use ImageMagick to convert the screenshots into an animated gifs.

convert output/* output.gif

you can optimize the screenshots this way:

convert output.gif -fuzz 10% -layers Optimize optimised.gif

 

Source: http://askubuntu.com/a/107735/65087

April 10, 2013

[SOLVED] Recursive image optimisation for web

use jpegoptim for jpeg files and optipng for pngs.

save this code to the file e.g., optimize.sh
#!/bin/bash
optimize() {
  jpegoptim *.jpg --strip-all --all-progressive --max=90
  for i in *
  do
    if test -d $i
    then
      cd $i
      echo $i
      optimize
      cd ..
    fi
  done
  echo
}
optimize

change permissions:
chmod +x optimize.sh

and run it in desired folder:
./optimize.sh


or

find . -name "*.jpg" -exec jpegoptim --strip-all --all-progressive --max=90 {} \;


Source: http://jmperezperez.com/jpegoptim-optimize-jpg-page-speed/