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

Home » Public Forums » archive » Re: Why does color change to b/w when using 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
Re: Why does color change to b/w when using PNG? [message #38519] Wed, 17 March 2004 12:15
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
Lawrence Bleau wrote:
> In article <c6d70400.0403161901.71f0d9b8@posting.google.com>, andrew.cool@dsto.defence.gov.au (Andrew Cool) writes:
>
>> bleau@UMTOF.UMD.EDU (Lawrence Bleau) wrote in message news:<c380s1$3hb$1@grapevine.wam.umd.edu>...
>>
>>> I'm running IDL 5.4 on OpenVMS 7.1-2 and am trying to do some plots.
>>>
>>> Previously, we were using the ps device (SET_PLOT,'PS') and generating
>>> PostScript files for each plot. We now want to generate PNG files as well.
>
> [snip]
>
>>> So, what's different between these two plot types (PS vs. PNG) that would
>>> cause the same code to produce different results? TIA.
>>
>> Wouldn't WRITE_PNG do the job for you?? Along with the R,G,B parameters.
>
>
> Thanks for the tip, Andrew. I specified the r,g,b arguments and it wrote
> out the color table as well as the image. Now I have a color image.
> That's the good news. Now for the bad.
>
> The plot looks absolutely horrible! This is by comparison with the PS plot
> made earlier. Something is seriously wrong here. To see what I mean, take
> a look at
>
> http://uleis.umd.edu/~bleau/ULEIS_2004_001_2004_005.PNG;4
>
> It should look something like
>
> http://uleis.umd.edu/docs/desai/GIFS/ULEIS_2004_001_2004_005 .GIF
>

Hello,

This probably won't solve your problem since you're running on an OpenVMS system, but I
have *never* found any way to make anything but PS output in IDL look good. To get around
this, I always create PS files and then, using the ImageMagick utilities that come bundled
with Red Hat linux, simply convert it to a gif file,
convert idl.ps idl.gif
The gif output is way better than direct png/gif/jpeg writes. And you don't have to output
gifs. Convert supports a crapload of file types.

I don't have plots anywhere near as fancy as yours, but you can see some examples at:
http://airs3.ssec.wisc.edu/~paulv/Fortran90/Emissivity/Senso r_Emissivity_Model/

Depending on what I'm doing, I either create the gif's by hand or invoke "convert" via
SPAWN in my IDL code.

On a whim, I went to the imagemagick site, http://www.imagemagick.org, and clicking on
"downloads" I saw a link to installation instructions for VMS:
http://www.imagemagick.org/www/Install-vms.html

paulv

p.s. This won't work if you want to do the surface overlay thingo detailed at
http://www.sljus.lu.se/stm/IDL/Surf_Tips/ though.
Re: Why does color change to b/w when using PNG? [message #38521 is a reply to message #38519] Wed, 17 March 2004 11:51 Go to previous message
bleau is currently offline  bleau
Messages: 24
Registered: November 1993
Junior Member
In article <c6d70400.0403161901.71f0d9b8@posting.google.com>, andrew.cool@dsto.defence.gov.au (Andrew Cool) writes:
> bleau@UMTOF.UMD.EDU (Lawrence Bleau) wrote in message news:<c380s1$3hb$1@grapevine.wam.umd.edu>...
>> I'm running IDL 5.4 on OpenVMS 7.1-2 and am trying to do some plots.
>>
>> Previously, we were using the ps device (SET_PLOT,'PS') and generating
>> PostScript files for each plot. We now want to generate PNG files as well.
[snip]
>> So, what's different between these two plot types (PS vs. PNG) that would
>> cause the same code to produce different results? TIA.
>
> Wouldn't WRITE_PNG do the job for you?? Along with the R,G,B parameters.

Thanks for the tip, Andrew. I specified the r,g,b arguments and it wrote
out the color table as well as the image. Now I have a color image.
That's the good news. Now for the bad.

The plot looks absolutely horrible! This is by comparison with the PS plot
made earlier. Something is seriously wrong here. To see what I mean, take
a look at

http://uleis.umd.edu/~bleau/ULEIS_2004_001_2004_005.PNG;4

It should look something like

http://uleis.umd.edu/docs/desai/GIFS/ULEIS_2004_001_2004_005 .GIF

In the PNG plot, the y-axis is way too short, the y-axis label runs the
wrong direction, the labelling near the top is scrunched together, and not
all of the data gets plotted (bottom plot missing).

Something is seriously different when using PNG vs. PS but using the exact
same plotting commands. Has anyone had experience with PNG?

As another test, I decided to write out a JPEG format as well. I just
added a call to WRITE_JPEG; see http://uleis.umd.edu/~bleau/ULEIS_2004_001_2004_005.JPG;1
This one, however, is completely black! It's like all color table entries
are 0s. The call to TVLCT is still there.

Could it be that TVLCT fails miserably with JPEG and PNG images, even
though it works with PS and GIF? If I can get the color table working with
the JPEG image I can then troubleshoot problems with the Z device vs.
problems with PNG per se.

So, I have two problems: major problem is poor plotting with PNG, minor
problem is how to get colors on a JPEG image (why TVLCT fails). TIA.

Lawrence Bleau
University of Maryland
Physics Dept., Space Physics Group
301-405-6223
bleau@umtof.umd.edu
Re: Why does color change to b/w when using PNG? [message #38523 is a reply to message #38521] Wed, 17 March 2004 09:56 Go to previous message
bleau is currently offline  bleau
Messages: 24
Registered: November 1993
Junior Member
In article <c6d70400.0403161901.71f0d9b8@posting.google.com>, andrew.cool@dsto.defence.gov.au (Andrew Cool) writes:
[snip]
>
>> So, what's different between these two plot types (PS vs. PNG) that would
>> cause the same code to produce different results? TIA.
>
> Wouldn't WRITE_PNG do the job for you?? Along with the R,G,B parameters.

I already use WRITE_PNG, after I call TVRD(). I just don't pass WRITE_PNG
the R,G,B parameters, and use the ones in the color table instead.

Do you know of a reason using TVLCT would not work for PNG files, and that
one might be required to call WRITE_PNG with R,G,B explicitly?

I will, however, try this and get back to you.

Lawrence Bleau
University of Maryland
Physics Dept., Space Physics Group
301-405-6223
bleau@umtof.umd.edu
Re: Why does color change to b/w when using PNG? [message #38535 is a reply to message #38523] Tue, 16 March 2004 19:01 Go to previous message
andrew.cool is currently offline  andrew.cool
Messages: 47
Registered: July 2003
Member
bleau@UMTOF.UMD.EDU (Lawrence Bleau) wrote in message news:<c380s1$3hb$1@grapevine.wam.umd.edu>...
> I'm running IDL 5.4 on OpenVMS 7.1-2 and am trying to do some plots.
>
> Previously, we were using the ps device (SET_PLOT,'PS') and generating
> PostScript files for each plot. We now want to generate PNG files as well.
>

snip

> So, what's different between these two plot types (PS vs. PNG) that would
> cause the same code to produce different results? TIA.
>
> Lawrence Bleau
> University of Maryland
> Physics Dept., Space Physics Group
> 301-405-6223
> bleau@umtof.umd.edu


Wouldn't WRITE_PNG do the job for you?? Along with the R,G,B parameters.

Andrew Cool
DSTO, Adelaide, South Australia
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: dynamically change the layout of widget
Next Topic: Problem with pointers to structures

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

Current Time: Wed Oct 08 14:52:16 PDT 2025

Total time taken to generate the page: 0.00889 seconds