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

Home » Public Forums » archive » idl gif files and display by dos viewer
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
idl gif files and display by dos viewer [message #4153] Wed, 10 May 1995 00:00 Go to next message
brooker is currently offline  brooker
Messages: 12
Registered: March 1994
Junior Member
I have a frame grabber card and a black and white camera. The frame grabber
digitizes an image to 8 bits and saves to a binary file that I read with the
following commands:

a=bytarr(320,240)
openr,lun,'image1.img',/get_lun
readu,lun,a

This image looks fine when I type: tv,a

I now want to save to a GIF file so that I can view the image on a PC
using the DOS viewer QPEG. IDL can do this by using the command:

write_gif,a,'image1.gif'

This seems to work fine because when I type the commands

read_gif,'image1.gif',b
tv,b

the image looks like the original.

The problem is that when I look at the same GIF file on a PC with the
DOS viewer QPEG, it looks terrible. The image is still there but now it
is mostly white.

Has anybody else ever had this problem??

Thanks-Peter Brooker
Re: idl gif files and display by dos viewer [message #4215 is a reply to message #4153] Fri, 12 May 1995 00:00 Go to previous message
Fergus Gallagher is currently offline  Fergus Gallagher
Messages: 41
Registered: January 1995
Member
brooker@toka.ireq-ccfm.hydro.qc.ca wrote:

> This image looks fine when I type: tv,a
>
> I now want to save to a GIF file so that I can view the image on a PC
> using the DOS viewer QPEG. IDL can do this by using the command:
>
> write_gif,a,'image1.gif'
>
> The problem is that when I look at the same GIF file on a PC with the
> DOS viewer QPEG, it looks terrible. The image is still there but now it
> is mostly white.

Works for me - can view a gif image written by the above procedure
succesfully on PC (under windows) and on Unix box.

I use IDL 3.6.1 on a SPARCstation




--

=================================================
| Fergus Gallagher |
| Remote Sensing Applications Development Unit |
| British National Space Centre |
| Monks Wood |
| Huntingdon PE17 2LS / UK |
| |
| F.Gallagher@nerc.ac.uk |
| http://uh.nmt.ac.uk/bnsc/fgg.html |
=================================================
Re: idl gif files and display by dos viewer [message #4218 is a reply to message #4153] Fri, 12 May 1995 00:00 Go to previous message
brooker is currently offline  brooker
Messages: 12
Registered: March 1994
Junior Member
problem solved!!! thanks to everyone for helping me out!!

the solution was to save the r,g,b color tables with the gif file.

i had to do:

tvlct,r,g,b,/get
write_gif,a,'image1.gif',r,g,b

this file comes up just fine when I view it with the qpeg viewer in
dos

thanks again- peter brooker

ps-this problem might only be for version 3.5
Re: idl gif files and display by dos viewer [message #4224 is a reply to message #4153] Fri, 12 May 1995 00:00 Go to previous message
pellet is currently offline  pellet
Messages: 12
Registered: October 1994
Junior Member
brooker@toka.ireq-ccfm.hydro.qc.ca wrote:
: I have a frame grabber card and a black and white camera. The frame grabber
: digitizes an image to 8 bits and saves to a binary file that I read with the
: following commands:

: a=bytarr(320,240)
: openr,lun,'image1.img',/get_lun
: readu,lun,a

: This image looks fine when I type: tv,a

: I now want to save to a GIF file so that I can view the image on a PC
: using the DOS viewer QPEG. IDL can do this by using the command:

: write_gif,a,'image1.gif'

: This seems to work fine because when I type the commands

: read_gif,'image1.gif',b
: tv,b

: the image looks like the original.

: The problem is that when I look at the same GIF file on a PC with the
: DOS viewer QPEG, it looks terrible. The image is still there but now it
: is mostly white.

: Has anybody else ever had this problem??


My guess is that the color table is not save properly with
the image.

Maybe you could try this after loading and viewing the
image:

...
tv, a

TVLCT, r, g, b, /GET ;Get current color table
WRITE_GIF, a, 'image1.gif', r, g, b ;Save image w/ color table

Hope this helps.

Jeff
pellet@INRS-ENER.UQuebec.CA
Re: idl gif files and display by dos viewer [message #4247 is a reply to message #4153] Wed, 10 May 1995 00:00 Go to previous message
afl is currently offline  afl
Messages: 51
Registered: December 1994
Member
|>
|> The problem is that when I look at the same GIF file on a PC with the
|> DOS viewer QPEG, it looks terrible. The image is still there but now it
|> is mostly white.
|>
|> Has anybody else ever had this problem??
|>


What if you save the r, g, b values with the
gif image, does that change things?

--

Andrew F. Loughe email: afl@cdc.noaa.gov
University of Colorado, CIRES voice: (303) 492-0707
Campus Box 449 fax: (303) 497-7013
Boulder, CO 80309-0449 USA
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Pixmap memory allocation question.
Next Topic: IDL> Looking for routine to list subdirectories.

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

Current Time: Wed Oct 08 19:44:15 PDT 2025

Total time taken to generate the page: 0.00730 seconds