[Index for tmp_for_tar/imgio] [Return to Master Index]

writegif

(tmp_for_tar/imgio/writegif.m)


Function Synopsis

writegif(fname, im, scale)

Help text

       writegif(fname, im)

 writegif      Write an image in PPM format to a file in GIF format.

		 writegif(fname, im, scale=1)
		 fname - file name.
		 im    - image to write into the file.
               scale - 0 - Don't scale values to [0,255]
                       1 - Scale values to [0,255]

               See also: writegraygif, writeppm, writepgm.

 Created: 30.6.98.
 Version: 1.0



Listing of function file tmp_for_tar/imgio/writegif.m

##       writegif(fname, im)
##
## Copyright (C) 1998 Ariel Tankus
## 
## This program is free software.
## This file is part of the Image Processing Toolbox for Octave
##
## This program is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License
## as published by the Free Software Foundation; either version 2
## of the License, or (at your option) any later version.
## 
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
## 
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
##

## writegif      Write an image in PPM format to a file in GIF format.
##
##		 writegif(fname, im, scale=1)
##		 fname - file name.
##		 im    - image to write into the file.
##               scale - 0 - Don't scale values to [0,255]
##                       1 - Scale values to [0,255]
##
##               See also: writegraygif, writeppm, writepgm.
##

## Author: Ariel Tankus <arielt@math.tau.ac.il>
## Created: 30.6.98.
## Version: 1.0

function writegif(fname, im, scale)

  if nargin<3, scale = 1 ; end
  ok = 1 ;
  ##  if (fid = popen(["ppmtogif >", fname], "w"))>0,
  ##      writeppm(fid, im, scale);
  ##      fclose(fid);
  if (fid = popen(["convert -compress none ppm:- ",fname],"w"))>0,
    writeppm(fid, im, scale);
    fclose(fid);
  else
    ok = 0 ;
  end
endfunction

Produced by oct2html on Sat Sep 14 9:47:03 2002
Cross-Directory links are: ON