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

Home » Public Forums » archive » Re: Red and Green Colors Swapped when Printing from Mac
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: Red and Green Colors Swapped when Printing from Mac [message #76414] Fri, 03 June 2011 12:59
Matt Haffner is currently offline  Matt Haffner
Messages: 34
Registered: October 2000
Member
On Jun 3, 12:10 pm, Mostafa <moselk...@gmail.com> wrote:

> On the graphics window, the plot is filled with blue colors in the
> outer contours and red/orange in the inner. The printout shows the
> outer contours in red colors and the inner in blue. However, the
> colorbar prints correctly.
>
> I hope it is not just my Mac nor me :)
>
> Thanks

I get output that is the same as the screen printing directly to two
different color printers (Dell & Lexmark) when using the print button
on the toolbar of a graphic using the workbench. This seems to go
right to the OS X print system (dialogs pop up, etc.).

The c.print procedure on the other hand does seem to traverse a
different code path. It looks like it's going through the PRINTER
device. I can't get it to go to any of my printers (using
DIALOG_PRINTERSETUP) without an error (CUPS reports "No %%BoundingBox:
comment in header!" on every job). If I have it go to a file instead,
the .eps is grayscale, as long despised by searching through this
group. PRINTER device settings don't seem to make a difference (e.g.,
TRUE, INDEX).

Likely the color issues are related to what "Printer Device" you have
selected as your default printer in DIALOG_PRINTERSETUP. From scanning
the printer settings files in $IDL_DIR/resource/xprinter/ppd/
nothing's been updated there since *1992*. Perhaps finding a new ppd
for your printer and dropping it in there will help, but I haven't
tried that myself yet.

Using the toolbutton in an X11 graphic window (e.g., if you run IDL
from the command line and not the workbench) uses PRINTER and will
result in this same problem, I believe.

Your best bet is to save the graphic as a PDF and print the file. An
extra line of code, but an order of magnitude less headache... hint...
hint... ITT...

- Matt
Re: Red and Green Colors Swapped when Printing from Mac [message #76415 is a reply to message #76414] Fri, 03 June 2011 10:10 Go to previous message
Mostafa is currently offline  Mostafa
Messages: 3
Registered: June 2011
Junior Member
On Jun 3, 10:44 am, Matt Haffner <matt.haff...@gmail.com> wrote:
>
> I've only used Mac IDL and have never seen this in DG or NG. Maybe the
> original poster has some code that shows the problem?
>
> - Matt

Certainly. I have used the sample code in the help page for CONTOUR
function and added a colorbar and print statement to it:

file = FILEPATH('convec.dat', SUBDIR=['examples', 'data'])
z = READ_BINARY(file,DATA_DIMS=[248,248])
index = [30,60,90,120,150,220,255]
c = CONTOUR(z, /FILL, ASPECT_RATIO=1, RGB_TABLE=39, RGB_INDICES=index,
C_VALUE=index)
b = COLORBAR(TARGET=c)
c.PRINT

On the graphics window, the plot is filled with blue colors in the
outer contours and red/orange in the inner. The printout shows the
outer contours in red colors and the inner in blue. However, the
colorbar prints correctly.

I hope it is not just my Mac nor me :)

Thanks
Re: Red and Green Colors Swapped when Printing from Mac [message #76416 is a reply to message #76415] Fri, 03 June 2011 09:44 Go to previous message
Matt Haffner is currently offline  Matt Haffner
Messages: 34
Registered: October 2000
Member
On Jun 3, 10:37 am, David Fanning <n...@idlcoyote.com> wrote:
> Mostafa writes:
>> Thank you David for the suggestions.
>
> Well, these were Coyote's suggestions. It's the first time,
> ever, one of them has been helpful!
>
>> I test printed from Widows and it sure did print well. Instead of
>> switching the cartridges, I tried on the Mac to grab the color table
>> using LOADCT and reversed the RGB order then redrew the same contour
>> on another window using that RGB table. The printout came well with
>> the original contour colors.
>
> Oh, my goodness! Does anyone know if this is a
> UNIX problem, or applies only to the Mac version?

I've only used Mac IDL and have never seen this in DG or NG. Maybe the
original poster has some code that shows the problem?

- Matt
Re: Red and Green Colors Swapped when Printing from Mac [message #76417 is a reply to message #76416] Fri, 03 June 2011 08:37 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Mostafa writes:

> Thank you David for the suggestions.

Well, these were Coyote's suggestions. It's the first time,
ever, one of them has been helpful!

> I test printed from Widows and it sure did print well. Instead of
> switching the cartridges, I tried on the Mac to grab the color table
> using LOADCT and reversed the RGB order then redrew the same contour
> on another window using that RGB table. The printout came well with
> the original contour colors.

Oh, my goodness! Does anyone know if this is a
UNIX problem, or applies only to the Mac version?

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: Red and Green Colors Swapped when Printing from Mac [message #76418 is a reply to message #76417] Fri, 03 June 2011 08:25 Go to previous message
Mostafa is currently offline  Mostafa
Messages: 3
Registered: June 2011
Junior Member
Thank you David for the suggestions.

I test printed from Widows and it sure did print well. Instead of
switching the cartridges, I tried on the Mac to grab the color table
using LOADCT and reversed the RGB order then redrew the same contour
on another window using that RGB table. The printout came well with
the original contour colors.

I think I will stick to Mac and use this workaround and hopefully
someday they will fix this problem.

Thanks again

Mostafa
Re: Red and Green Colors Swapped when Printing from Mac [message #76422 is a reply to message #76418] Thu, 02 June 2011 16:57 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Mostafa writes:

> I am using IDL 8.1 on MacOSX 10.6.7. When trying to print a plot using
> IDL Graphics, I noticed that the red and blue color components are
> swapped on the printout. This happens for BARPLOT and CONTOUR.
> However, the COLORBAR associated with the contour prints out
> correctly. Also printing the window of IMAGE function also prints the
> correct colors.
>
> Anyone seen this problem and knows what causes it?

I have two suggestions.

1. Print only on Windows printers.
2. Switch the red and blue color cartridges on
the printer you are using.

Microsoft gets the whole color thing sort of ass
backwards for some reason. It wouldn't surprise
me to find this kind of error in a print routine.
And, especially, when printing from a Mac, which
seems to go out of its way to do things in the
anti-Windows way.

Maybe I'm getting old, but the whole UNIX/Windows,
Republican/Democrat thing is starting to get under
my skin a little bit. Almost worse than having
children living in the house. :-(

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Red and Green Colors Swapped when Printing from Mac
Next Topic: DICOM image query crashes IDL

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

Current Time: Wed Oct 08 13:56:15 PDT 2025

Total time taken to generate the page: 0.00613 seconds