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

Home » Public Forums » archive » help with write_gif - Image must be a byte matrix.
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
help with write_gif - Image must be a byte matrix. [message #90964] Tue, 19 May 2015 07:21 Go to next message
g.nacarts is currently offline  g.nacarts
Messages: 148
Registered: November 2013
Senior Member
Hi I have a 3D array, Image=[time,dimension_x,dimension_y]

I wrote the following code

for i=0L,n-1 do begin
im = reform(image[i,*,*])
im = BYTSCL(im, max=200.)
write_gif, im, file, /multiple
endfor
write_gif, file, /close

and I got this error: WRITE_GIF: Image must be a byte matrix. I used the BYTSCL function to convert my array to byte matrix but seems I am doing something wrong. Can anyone help?
Re: help with write_gif - Image must be a byte matrix. [message #90965 is a reply to message #90964] Tue, 19 May 2015 07:36 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
g.nacarts@gmail.com writes:

> Hi I have a 3D array, Image=[time,dimension_x,dimension_y]
>
> I wrote the following code
>
> for i=0L,n-1 do begin
> im = reform(image[i,*,*])
> im = BYTSCL(im, max=200.)
> write_gif, im, file, /multiple
> endfor
> write_gif, file, /close
>
> and I got this error: WRITE_GIF: Image must be a byte matrix. I used the BYTSCL function to convert my array to byte matrix but seems I am doing something wrong. Can anyone help?

Check the order of your arguments. You have them reversed, it looks
like.

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
Re: help with write_gif - Image must be a byte matrix. [message #90966 is a reply to message #90965] Tue, 19 May 2015 07:53 Go to previous messageGo to next message
g.nacarts is currently offline  g.nacarts
Messages: 148
Registered: November 2013
Senior Member
Sorry I can't see what you mean. Where exactly did I reverse my arguments?
Re: help with write_gif - Image must be a byte matrix. [message #90967 is a reply to message #90966] Tue, 19 May 2015 07:59 Go to previous messageGo to next message
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
On Tuesday, May 19, 2015 at 4:53:46 PM UTC+2, g.na...@gmail.com wrote:
> Sorry I can't see what you mean. Where exactly did I reverse my arguments?

David means
correct:
WRITE_GIF, Filename, Image
wrong:
WRITE_GIF, Image, Filename

cheers, h
Re: help with write_gif - Image must be a byte matrix. [message #90968 is a reply to message #90967] Tue, 19 May 2015 08:05 Go to previous message
g.nacarts is currently offline  g.nacarts
Messages: 148
Registered: November 2013
Senior Member
Ah ok. Thanks :)
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Suppress print statement from nested procedures
Next Topic: calling functions directily

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

Current Time: Wed Oct 08 07:23:45 PDT 2025

Total time taken to generate the page: 0.00473 seconds