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

Home » Public Forums » archive » write_png
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
write_png [message #28652] Tue, 25 December 2001 23:22 Go to next message
Kenlo Nishida is currently offline  Kenlo Nishida
Messages: 5
Registered: April 2001
Junior Member
Have anyone tried write_png to create image
file in PNG format? Whenever I tried, the
output image is very different from original
one, containing lots of stripes of blank.
When I tried write_bmp instead of write_png,
it's OK. Therefore, I guess it is due to some
errors in write_png. My IDL is version 5.5
on Linux.

Thanks.

--
Kenlo Nishida
kenlo@ntsg.umt.edu
Numerical Terradynamic Simulation Group (NTSG)
School of Forestry, University of Montana
Missoula, MT59812
Tel: (406) 243-4693
Fax: (406) 243-4510
Re: write_PNG [message #40987 is a reply to message #28652] Fri, 17 September 2004 08:18 Go to previous message
Michael Wallace is currently offline  Michael Wallace
Messages: 409
Registered: December 2003
Senior Member
> If I remember right, it's not really an 8-bit or 24-bit issue. It's
> that WRITE_PNG expects the image to be interleaved over the first
> dimension. I usually interleave 24-bit images over the 3rd dimension,
> so I have to remember to set TRUE = 1 in TVRD.
>
> I don't have an 8-bit display to test it with. Is TRUE = 1 ignored in
> that case?

I really don't know if it's ignored or not.

My 8-bit vs 24-bit comment was based on the documentation in TVRead.
One thing I had forgotten about TVRead() is that a file output option is
included, so just one call to TVRead() will be able to read the display
and write an image file.

--- From the documentation ---

To get accurate screen dumps with the IDL command TVRD on 24-bit PC and
Macintosh computers, you have to be sure to set color decomposition on.
This program adds that capability automatically. In addition, the
program will optionally write BMP, GIF, JPEG, PICT, PNG, and TIFF color
image files of the screen dump.

image = TVREAD(xstart, ystart, ncols, nrows)

The returned image will be a 2D image on 8-bit systems and a 24-bit
pixel interleaved true-color image on 24-bit systems.
Re: write_PNG [message #40988 is a reply to message #28652] Fri, 17 September 2004 07:49 Go to previous message
K. Bowman is currently offline  K. Bowman
Messages: 330
Registered: May 2000
Senior Member
In article <10klttimk7lnb76@corp.supernews.com>,
Michael Wallace <mwallace.no.spam@no.spam.swri.edu.invalid> wrote:

> Use David's TVRead() command so that you don't have to be concerned with
> the whole 8-bit vs 24-bit thing.
>
> image = tvread()
> write_png, 'plot.png', image
>
> Just another way to skin a cat.
>
> -Mike

If I remember right, it's not really an 8-bit or 24-bit issue. It's
that WRITE_PNG expects the image to be interleaved over the first
dimension. I usually interleave 24-bit images over the 3rd dimension,
so I have to remember to set TRUE = 1 in TVRD.

I don't have an 8-bit display to test it with. Is TRUE = 1 ignored in
that case?

Ken
Re: write_PNG [message #40989 is a reply to message #28652] Fri, 17 September 2004 07:41 Go to previous message
Michael Wallace is currently offline  Michael Wallace
Messages: 409
Registered: December 2003
Senior Member
> PLOT, ...
> image = TVRD(TRUE = 1) ;24-bitdisplay
> WRITE_IMAGE, 'plot.png', 'PNG', image ;Write PNG
>
>
> Ken Bowman


Or....
Use David's TVRead() command so that you don't have to be concerned with
the whole 8-bit vs 24-bit thing.

image = tvread()
write_png, 'plot.png', image

Just another way to skin a cat.

-Mike
Re: write_PNG [message #41012 is a reply to message #28652] Thu, 16 September 2004 14:19 Go to previous message
K. Bowman is currently offline  K. Bowman
Messages: 330
Registered: May 2000
Senior Member
In article <4cbae60f.0409161315.5738b3c5@posting.google.com>,
adharac@hotmail.com (Adhara) wrote:

> I want to write PNG frames but my data does not come from an array
> itself, but from the output of Flow3 and Plots. Is it possible to use
> Write_PNG from this?

PLOT, ...
image = TVRD(TRUE = 1) ;24-bitdisplay
WRITE_IMAGE, 'plot.png', 'PNG', image ;Write PNG


Ken Bowman
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Help displaying live video
Next Topic: Re: Greetings From Munich

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

Current Time: Sat Oct 11 14:44:01 PDT 2025

Total time taken to generate the page: 1.28115 seconds