comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Animated GIF in IDL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Animated GIF in IDL [message #31860 is a reply to message #31840] Wed, 21 August 2002 00:52 Go to previous messageGo to previous message
Timm Weitkamp is currently offline  Timm Weitkamp
Messages: 66
Registered: August 2002
Member
Kasia,

On 20.08.02 at 17:31 -0500, Craig Markwardt wrote:

> [...]
>
> The question is how do you make *any* GIFs in IDL? Older version of
> IDL are able to make GIFs, and animated GIFs are documented in
> WRITE_GIF.
>
> If you have some older versions of IDL lying around, then it may be
> possible to take the GIF dlm from the old version and copy it to your
> new version directory, and then be able to use it. The only way to
> find out is to try it.
>
> [...]

As Craig points out, in recent versions of IDL the GIF support is disabled
for patent reasons. But in case you do have the WRITE_GIF routine running
on your system, below you find a routine that gives you an easy interface
for writing animated GIFs from an image array stack. It just only calls
WRITE_GIF several times with the appropriate arguments to create an
animated GIF from the input image stack.

(Whether WRITE_GIF runs on your computer can be easily tested. Just type
at the IDL command line something like,

WRITE_GIF, 'test.gif', BINDGEN(16,16)

and see what happens.)

Now below's my old routine for writing animated GIFs. May it be useful...

Cheers,
Timm

;+
; NAME:
; WRITE_MULTIGIF
;
; PURPOSE:
; Write multiple images to a GIF file, creating a movie.
;
; CATEGORY:
; Image format conversion
;
; CALLING SEQUENCE:
; WRITE_MULTIGIF, <filename>, <3darr> [, r, g, b]
;
; INPUTS:
; filename A scalar string containing the full pathname
; of the GIF file to write
; 3darr A three-dimensional array of type BYTE.
; Dimensions are (x,y,n), where x and y are the
; pixel dimensions of the images and n the number of frames.
;
; OPTIONAL INPUTS:
; r,g,b Red, green, blue vectors (are passed to WRITE_GIF)
;
; KEYWORD PARAMETERS:
; VERBOSE Set this to get some text output during operation.
;
; MODIFICATION HISTORY:
; 27 Sep 1999 Written by Timm Weitkamp, ESRF
;-

PRO write_multigif, filename, array, r, g, b, VERBOSE=verbose

IF N_PARAMS() LT 2 THEN BEGIN
PRINT, '*** Usage: WRITE_MULTIGIF, filename, array [, r, g, b]'
PRINT, ' array is BYTARR(x,y,n)'
PRINT, ' r, g, b as in WRITE_GIF'
ENDIF

n=(SIZE(array))[3]

FOR i=1,n DO BEGIN
IF KEYWORD_SET(verbose) THEN $
PRINT, filename, i, n $
, FORMAT='("*** Multi-GIF ",A,": Writing frame",I4,"/",I4)'
IF N_ELEMENTS(r) GT 0 THEN $
WRITE_GIF, /MULTIPLE, filename, array[*,*,i-1], r, g, b $
ELSE $
WRITE_GIF, /MULTIPLE, filename, array[*,*,i-1]
ENDFOR
WRITE_GIF, filename, /CLOSE

END
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: From a novice in IDL
Next Topic: IDLdbDatabase - how to check the connected dataSource name?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 04:26:55 PDT 2025

Total time taken to generate the page: 0.78874 seconds