Re: Write PNG from plots with different color tables?? [message #69868] |
Tue, 02 March 2010 16:17  |
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 #69871 is a reply to message #69869] |
Tue, 02 March 2010 11:30   |
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   |
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  |
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
|
|
|
|