graphical   user    interface (GUI),    and there   are few,    if  any,    graphics    file
formats that    cannot  be  manipulated when    using   Linux.  These   programs    can
be  called  in  Perl    scripts,    shell   scripts,    or  command-line    pipes   to  support
many    types   of  complex format-conversion   and image-manipulation  tasks.
See the man pages   for the ppm,    pbm,    pnm,    and pgm families    of  commands.
Also    see the man page    for the convert command,    which   is  part    of  the
extremely   capable ImageMagick suite   of  programs.Sometimes,  a   file    you want    to  manipulate  in  some    way is  in  a   format  that
cannot  be  used    by  either  your    graphics    application or  the final   application.
The solution    is  to  convert the image   file—sometimes  through several formats.
The convert utility from    ImageMagick is  useful, as  is  the netpbm  family
of  utilities.  If  it  is  not already installed,  you can easily  install ImageMagick
from    the Ubuntu  repositories;   the netpbm  tools   are always  installed   by
default.
convert is super simple to use from the command line. Here is an example:
Click   here    to  view    code    image
matthew@seymour~:$  convert image.gif   image.png
The convert utility converts    between image   formats recognized  by
ImageMagick.    You can also    manipulate  color   depth   and size    during  the
conversion  process.    You can use ImageMagick to  append  images, surround
them    with    borders,    add labels, rotate  and shade   them,   and perform other
manipulations   well    suited  to  scripting.  Other   commands    associated  with
ImageMagick include display,    animate,    identify,   and import. The
application supports    more    than    130 different   image   formats (all    listed  in  the
man page    for ImageMagick).
The netpbm  tools   are installed   by  default because they    compose the
underpinnings   of  graphics    format  manipulation.   The man page    for each    image
format  lists   related conversion  utilities;  the number  of  those   utilities   gives   you
some    indication  of  the way each    format  is  used    and shows   how one is  built   on
another:
ppm—The man page    for ppm,    the portable    pixmap  file    format, lists   47
conversion  utilities   related to  ppm.    This    makes   sense   because ppm is
considered  the lowest  common  denominator for color   image   files.  It  is
therefore   often   used    as  an  intermediate    format.
pgm—The man page    for pgm,    the portable    graymap file    format, lists   22
conversion  utilities.  This    makes   sense   because pgm is  the lowest
common  denominator for grayscale   image   files.