write_png [message #28652] |
Tue, 25 December 2001 23:22  |
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  |
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  |
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  |
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
|
|
|
|