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

Home » Public Forums » archive » Re: Screen dump to file - color problems
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: Screen dump to file - color problems [message #35790] Wed, 16 July 2003 20:28
Richard French is currently offline  Richard French
Messages: 173
Registered: December 2000
Senior Member
On 7/16/03 9:08 PM, in article BB3B3262.AD6%rfrench@wellesley.edu, "Richard
G. French" <rfrench@wellesley.edu> wrote:

> On 7/16/03 3:05 PM, in article MPG.197f4ff75447029b9896aa@news.frii.com,
> "David Fanning" <david@dfanning.com> wrote:
>
>> Richard G. French writes:
>>
>>> Thanks for any hints.
>>
>> Do you know those little, tiny square glasses they
>> use for viewing 3D movies? Might work. :-)
>>
>> If you tried all this and you are still having problems,
>> my guess is "bug". But before we give in, is your
>> display set to 16-bit or 24-bit graphics? In other
>> words, what is the result of this command?
>>
>> IDL> Device, Get_Visual_Depth=theDepth & Print, theDepth
>>
>> Cheers,
>>
>> David
>
> YES, I get 24.
>
> Anyone else have a PowerBookG4 running X11 that you can try this on?
>
> By the way, I was running idl, not idlde. Not sure if that would make any
> difference, but I'll try it.
>
> Is there a chance that something in my idl.startup file could be messing
> things up? Possibly relevant lines in the file are:
>
> device,true_color=24
> window,/FREE,/PIXMAP,colors=-10,xsize=10,ysize=10
> wdelete,!d.window
> device,decomposed=0,retain=1
> device,BYPASS_TRANSLATION=0 ; to fix color problem in IDL5.5
>
>

The offending command was the last one - I am not sure what problem in
IDL5.5 was supposedly solved by including this command, but when I delete
it, the screen capture works correctly. Thanks to those of you who gave me
some help on this. Everything had worked under IDL5.5, now that I think of
it. I'm delighted!

Dick
Re: Screen dump to file - color problems [message #35791 is a reply to message #35790] Wed, 16 July 2003 18:08 Go to previous message
Richard French is currently offline  Richard French
Messages: 173
Registered: December 2000
Senior Member
On 7/16/03 3:05 PM, in article MPG.197f4ff75447029b9896aa@news.frii.com,
"David Fanning" <david@dfanning.com> wrote:

> Richard G. French writes:
>
>> Thanks for any hints.
>
> Do you know those little, tiny square glasses they
> use for viewing 3D movies? Might work. :-)
>
> If you tried all this and you are still having problems,
> my guess is "bug". But before we give in, is your
> display set to 16-bit or 24-bit graphics? In other
> words, what is the result of this command?
>
> IDL> Device, Get_Visual_Depth=theDepth & Print, theDepth
>
> Cheers,
>
> David

YES, I get 24.

Anyone else have a PowerBookG4 running X11 that you can try this on?

By the way, I was running idl, not idlde. Not sure if that would make any
difference, but I'll try it.

Is there a chance that something in my idl.startup file could be messing
things up? Possibly relevant lines in the file are:

device,true_color=24
window,/FREE,/PIXMAP,colors=-10,xsize=10,ysize=10
wdelete,!d.window
device,decomposed=0,retain=1
device,BYPASS_TRANSLATION=0 ; to fix color problem in IDL5.5
Re: Screen dump to file - color problems [message #35792 is a reply to message #35791] Wed, 16 July 2003 15:16 Go to previous message
Karl Schultz is currently offline  Karl Schultz
Messages: 341
Registered: October 1999
Senior Member
"Richard G. French" <rfrench@wellesley.edu> wrote in message
news:BB3B0ABB.ACC%rfrench@wellesley.edu...
> I'm running IDL5.6 on a Mac and I'm having trouble getting a screen dump
of
> a color image to a file - the colors are not working properly. I've tried
> using David Fanning's TVREAD(), I've tried FSC_WINDOW, and I've tried
every
> combination of decomposed=0, decomposed=1, TRUE=1, TRUE=0, etc with no
> success. Two symptoms - the background color of the window was supposed to
> be white, but it ends up being blue; the color table for the image itself
> seemsm to be wrapped over itself.
>
> Can someone help save my sanity? Here is what fails on my Mac running OS
> 10.2 and X11 Beta 3 - XFree86 4.2.1
>
> IDL> help,/dev
> Available Graphics Devices: CGM HP LJ NULL PCL PRINTER PS REGIS TEK X Z
> Current graphics device: X
> Server: X11.0, The XFree86 Project, Inc, Release 40201000
> Display Depth, Size: 24 bits, (2560,1024)
> Visual Class: TrueColor (4)
> Bits Per RGB: 8 (8/8/8)
> Physical Color Map Entries (Emulated / Actual): 256 / 256
> Colormap: Shared, 16777216 colors. Translation table: Enabled
> Graphics pixels: Combined, Dither Method: Ordered
> Write Mask: 16777215 (decimal) ffffff (hex)
> Graphics Function: 3 (copy)
> Current Font: <default>, Current TrueType Font: <default>
> Default Backing Store: Req from Server.
> IDL> print,!version
> { ppc darwin unix Mac OS X 5.6 Oct 26 2002 32 32}
>
>
> I tried just doing the actual TVRD() commands, following what is in the
guts
> of David Fanning's TVREAD:
>
>
> Device,decomposed=0 ; for the display of the image
> Loadct,3
> Window,xsize=400,ysize=400
> Erase,color=255 ; make white background
> Tvscl,dist(300),50,50
> Device,decomposed=1
> Result=tvrd(/TRUE)
> Write_jpeg,'tryit.jpg',result,/TRUE
> Device,decomposed=0
>
> When I display the jpeg file, I get a blue background and a green diamond
in
> the middle of the image.
>
> I'm willing to admit that I am blind and stupid! I'm using code that seems
> to have worked last year on whatever machine I might have been using, but
I
> can't get it to work now, and it is driving me crazy.

I ran your code sequence on a Mac running 10.2 and X11 Beta 0.2 and got the
right results.

I'm thinking that the problem might be that you are using X11 Beta 0.3.
Apple added 8-bit visual support in 0.3, but there are a lot of bugs in this
support that can cause some pretty strange problems with Direct Graphics.
We noticed a lot of problems with displaying image data. And if there are
problems with displaying the images, there certainly can be problems with
reading them back.

We've reported all this to Apple, but unfortunately, there will be no more
Beta X11 releases for 10.2. The soonest you'll be able to get a fix for
this is when 10.3 comes out and you'll have to upgrade to that.

In the meantime, you might try going back to Beta 0.2.

Karl
Re: Screen dump to file - color problems [message #35793 is a reply to message #35792] Wed, 16 July 2003 13:12 Go to previous message
btt is currently offline  btt
Messages: 345
Registered: December 2000
Senior Member
David Fanning wrote:

> If you tried all this and you are still having problems,
> my guess is "bug". But before we give in, is your
> display set to 16-bit or 24-bit graphics? In other
> words, what is the result of this command?
>
> IDL> Device, Get_Visual_Depth=theDepth & Print, theDepth

Hi,

I get the proper color scheme in the jpeg with the following using your
code. The following is from my machine before I run your code...

IDL> device, get_visual_depth = vdepth & help, vdepth
VDEPTH LONG = 24
IDL> print, !version
{ ppc darwin unix Mac OS X 5.6 Oct 26 2002 32 32}
IDL> help, /dev
Available Graphics Devices: CGM HP LJ NULL PCL PRINTER PS REGIS TEK X Z
Current graphics device: X
Server: X11.0, The XFree86 Project, Inc, Release 40200000
Display Depth, Size: 24 bits, (1280,1003)
Visual Class: TrueColor (4)
Bits Per RGB: 8 (8/8/8)
Physical Color Map Entries (Emulated / Actual): 256 / 256
Colormap: Private, 16777216 colors. Translation table: Enabled
Graphics pixels: Decomposed, Dither Method: Ordered
Write Mask: 16777215 (decimal) ffffff (hex)
Graphics Function: 3 (copy)
Current Font: <default>, Current TrueType Font: <default>
Default Backing Store: Req from Server.


There is a different release number for X11. Also, your "Graphics
pixels" are combined while mine are decomposed.



Ben
Re: Screen dump to file - color problems [message #35794 is a reply to message #35793] Wed, 16 July 2003 12:05 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Richard G. French writes:

> Thanks for any hints.

Do you know those little, tiny square glasses they
use for viewing 3D movies? Might work. :-)

If you tried all this and you are still having problems,
my guess is "bug". But before we give in, is your
display set to 16-bit or 24-bit graphics? In other
words, what is the result of this command?

IDL> Device, Get_Visual_Depth=theDepth & Print, theDepth

Cheers,

David

--
David W. Fanning, Ph.D.
Fanning Software Consulting, Inc.
Phone: 970-221-0438, E-mail: david@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Screen dump to file - color problems
Next Topic: How to find out the best fitted function ?

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

Current Time: Wed Oct 08 13:59:26 PDT 2025

Total time taken to generate the page: 0.00800 seconds