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

Home » Public Forums » archive » Re: Write PNG from plots with different color tables??
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: Write PNG from plots with different color tables?? [message #69868] Tue, 02 March 2010 16:17 Go to next message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Mar 2, 9:06 pm, pp <pp.pente...@gmail.com> wrote:
> On Mar 2, 4:30 pm, Mark Shephard <mark.w.sheph...@gmail.com> wrote:
>
>
>
>> Hi PP,
>
>> Thanks for the prompt response.  I had already tried what you
>> suggested.  When I do so I get a very strange result.  The top half is
>> completely black and the bottom half has the plot repeated three times
>> (still using just one of the color tables).
>
>> ----------------
>> |              |
>> |  BLACK       |
>> |              |
>> ----------------
>> |              |
>> | P1   P1   P1 |
>> |              |
>> ----------------

Just noticed that the default pixel depth was 8, not 24 as I thought.
So tvrd was trying to do something weird, trying to read 3 bytes for
each pixel, where there was only 1. Adding, device,/
set_pixel_depth=24, before the first plot, solves the problem.
Re: Write PNG from plots with different color tables?? [message #69869 is a reply to message #69868] Tue, 02 March 2010 16:06 Go to previous messageGo to next message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Mar 2, 4:30 pm, Mark Shephard <mark.w.sheph...@gmail.com> wrote:
> Hi PP,
>
> Thanks for the prompt response.  I had already tried what you
> suggested.  When I do so I get a very strange result.  The top half is
> completely black and the bottom half has the plot repeated three times
> (still using just one of the color tables).
>
> ----------------
> |              |
> |  BLACK       |
> |              |
> ----------------
> |              |
> | P1   P1   P1 |
> |              |
> ----------------

I did not expect that. I tried, and got something similar. It looks
sort of like the result of getting the wrong interleaving. But I do
not know why that is happening. It is not an issue with write_png, as
I displayed the array returned by tvrd, and it looked that way.
Re: Write PNG from plots with different color tables?? [message #69871 is a reply to message #69869] Tue, 02 March 2010 11:30 Go to previous messageGo to next message
Mark Shephard is currently offline  Mark Shephard
Messages: 13
Registered: July 1999
Junior Member
Hi PP,

Thanks for the prompt response. I had already tried what you
suggested. When I do so I get a very strange result. The top half is
completely black and the bottom half has the plot repeated three times
(still using just one of the color tables).

----------------
| |
| BLACK |
| |
----------------
| |
| P1 P1 P1 |
| |
----------------

Any thoughts?

Thanks,
Mark


On Mar 2, 2:06 pm, pp <pp.pente...@gmail.com> wrote:
> On Mar 2, 3:51 pm, Mark Shephard <mark.w.sheph...@gmail.com> wrote:
>
>> image = tvrd()
>> write_png, file_out, image, r, g, b
>
> Do it without color tables instead:
>
> image=tvrd(true=1)
> write_png,file_out,image
Re: Write PNG from plots with different color tables?? [message #69872 is a reply to message #69871] Tue, 02 March 2010 11:06 Go to previous messageGo to next message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Mar 2, 3:51 pm, Mark Shephard <mark.w.sheph...@gmail.com> wrote:
> image = tvrd()
> write_png, file_out, image, r, g, b

Do it without color tables instead:

image=tvrd(true=1)
write_png,file_out,image
Re: Write PNG from plots with different color tables?? [message #70016 is a reply to message #69871] Wed, 03 March 2010 07:14 Go to previous message
ben.bighair is currently offline  ben.bighair
Messages: 221
Registered: April 2007
Senior Member
On Mar 2, 2:30 pm, Mark Shephard <mark.w.sheph...@gmail.com> wrote:
> Hi PP,
>
> Thanks for the prompt response.  I had already tried what you
> suggested.  When I do so I get a very strange result.  The top half is
> completely black and the bottom half has the plot repeated three times
> (still using just one of the color tables).
>
> ----------------
> |              |
> |  BLACK       |
> |              |
> ----------------
> |              |
> | P1   P1   P1 |
> |              |
> ----------------
>
> Any thoughts?
>
> Thanks,
> Mark
>
> On Mar 2, 2:06 pm, pp <pp.pente...@gmail.com> wrote:
>
>> On Mar 2, 3:51 pm, Mark Shephard <mark.w.sheph...@gmail.com> wrote:
>
>>> image = tvrd()
>>> write_png, file_out, image, r, g, b
>
>> Do it without color tables instead:
>
>> image=tvrd(true=1)
>> write_png,file_out,image
>
>

Hi,

What happens if you use David Fanning's handy TVREAD rather than IDL's
built-in TVRD?

http://dfanning.com/color_tips/strange_tvrd.html

Ben
Re: Write PNG from plots with different color tables?? [message #70017 is a reply to message #69871] Wed, 03 March 2010 03:13 Go to previous message
jkeller is currently offline  jkeller
Messages: 35
Registered: October 2009
Member
If you use X-Windows you should probably also use
DEVICE,BYPASS_TRANSLATION=1

Before I used this (it took me 7 years to figure this out) I always
got mad using TVRD().

Regards,
Jan
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: 3-D (stereo) visualization
Next Topic: How to add a new tag to N structures

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

Current Time: Wed Oct 08 19:43:11 PDT 2025

Total time taken to generate the page: 0.01218 seconds