[UP]


Manual Reference Pages  - writegif (3)

NAME

writegif(3f) - [M_writegif] Codes pixel-map with palette into GIF format. Optional transparent color (LICENSE:PD)

CONTENTS

Synopsis
Description
Options
Example
Author
License

SYNOPSIS

subroutine writegif (FileName, Pixel, ColorMap, Transparent)

   character(len=*), intent(in)         :: FileName
   integer, intent(in), dimension(:,:)  :: Pixel
   integer, intent(in), dimension(:,0:) :: ColorMap
   integer, intent(in), optional        :: Transparent

DESCRIPTION

Write GIF file from pixel array and color map.

OPTIONS

FileName
  file to create or replace
Pixel Pixel values 0 to ncol
ColorMap
  Color map (RGB 0:255 for colours 0:ncol)
Transparent
  Optional

EXAMPLE

Sample call:

   program demo_writegif
   use M_writegif, only : writegif
   integer  :: Pixel(100,100)
   integer  :: Transparent = 0
   integer  :: ColorMap (3,0:7)
   colormap(:,0)=[255,255,255]
   colormap(:,1)=[255,  0,  0]
   colormap(:,2)=[  0,255,  0]
   colormap(:,3)=[  0,  0,255]
   colormap(:,4)=[255,255,  0]
   colormap(:,5)=[255,  0,255]
   colormap(:,6)=[  0,255,255]
   colormap(:,7)=[  0,  0,  0]

! put some colored boxes into pixmap pixel(:,:)=0 pixel(1:80,1:80)=1 pixel(11:20,11:20)=2 pixel(21:40,21:40)=3

! write gif with a transparent background call writegif(’boxes_t.gif’,pixel,ColorMap,Transparent)

! change background color and write standard gif file where (pixel.eq.0) pixel=4 call writegif(’boxes.gif’,pixel,ColorMap)

end program demo_writegif

AUTHOR

o Version 1.01, 1999 August: Written by Jos Bergervoet
o Version 2, 2008 Jan 28: Modified by Clive Page to use stream I/O, array as colourmap.
o Version 3, 2017 July 6: Modified by John Urban to make it easier to use with M_PIXEL(3f) module.

LICENSE

License: public domain.


writegif (3) October 17, 2020
Generated by manServer 1.08 from 19943510-5d5d-4f3f-a93a-3555d9c17889 using man macros.