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

Home » Public Forums » archive » Re: eps output with xplot or fsc_surface
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: eps output with xplot or fsc_surface [message #61671] Mon, 28 July 2008 12:03
humanumbrella is currently offline  humanumbrella
Messages: 52
Registered: June 2008
Member
On Jul 28, 2:44 pm, humanumbre...@gmail.com wrote:
> On Jul 28, 1:45 pm, David Fanning <n...@dfanning.com> wrote:
>
>
>
>> humanumbre...@gmail.com writes:
>>> The above code creates a bigger image, and it comes back as the same
>>> size as what you initially saved it as, but it is not necessarily more
>>> detailed.  I am continuing work on this and will report some more
>>> findings (:
>
>> Actually, I think this is correct, if you have one more step.
>> I try something like this:
>
>>    'EPS-600': BEGIN
>>         resolution = [2.54/600, 2.54/600]
>>         viewDimensions = 600/72.
>>         END
>
>> Then,
>
>>    info.thisWindow->GetProperty, $
>>        Dimensions=theDimensions, Units=theUnits
>>    clipboard = Obj_New('IDLgrClipboard', $    
>>         Dimensions=viewDimensions*theDimensions, $
>>         Resolution=resolution, Units=theUnits, Quality=2)
>
>> That produces a (gigantic!) PostScript file, but I think
>> it is of the correct dimensions, at least.
>
>> Cheers,
>
>> David
>> --
>> David Fanning, Ph.D.
>> Fanning Software Consulting, Inc.
>> Coyote's Guide to IDL Programming:http://www.dfanning.com/
>> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
>
> It appears that if you pass the /vector keyword as well, it will
> drastically reduce the filesizes.
>
> Cheers,
> --Justin

Finally, for my application I believe I will use the /vector keyword
with the /postscript, so the filesize will be smaller. This will
allow for the postscript reader to rasterize its own vectors instead
of saving all of that information in the file.

Hope that helps some people =P

Cheers,
--Justin
Re: eps output with xplot or fsc_surface [message #61672 is a reply to message #61671] Mon, 28 July 2008 11:44 Go to previous message
humanumbrella is currently offline  humanumbrella
Messages: 52
Registered: June 2008
Member
On Jul 28, 1:45 pm, David Fanning <n...@dfanning.com> wrote:
> humanumbre...@gmail.com writes:
>> The above code creates a bigger image, and it comes back as the same
>> size as what you initially saved it as, but it is not necessarily more
>> detailed.  I am continuing work on this and will report some more
>> findings (:
>
> Actually, I think this is correct, if you have one more step.
> I try something like this:
>
>    'EPS-600': BEGIN
>         resolution = [2.54/600, 2.54/600]
>         viewDimensions = 600/72.
>         END
>
> Then,
>
>    info.thisWindow->GetProperty, $
>        Dimensions=theDimensions, Units=theUnits
>    clipboard = Obj_New('IDLgrClipboard', $    
>         Dimensions=viewDimensions*theDimensions, $
>         Resolution=resolution, Units=theUnits, Quality=2)
>
> That produces a (gigantic!) PostScript file, but I think
> it is of the correct dimensions, at least.
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")

It appears that if you pass the /vector keyword as well, it will
drastically reduce the filesizes.

Cheers,
--Justin
Re: eps output with xplot or fsc_surface [message #61678 is a reply to message #61672] Mon, 28 July 2008 10:45 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
humanumbrella@gmail.com writes:

> The above code creates a bigger image, and it comes back as the same
> size as what you initially saved it as, but it is not necessarily more
> detailed. I am continuing work on this and will report some more
> findings (:

Actually, I think this is correct, if you have one more step.
I try something like this:

'EPS-600': BEGIN
resolution = [2.54/600, 2.54/600]
viewDimensions = 600/72.
END

Then,

info.thisWindow->GetProperty, $
Dimensions=theDimensions, Units=theUnits
clipboard = Obj_New('IDLgrClipboard', $
Dimensions=viewDimensions*theDimensions, $
Resolution=resolution, Units=theUnits, Quality=2)

That produces a (gigantic!) PostScript file, but I think
it is of the correct dimensions, at least.

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: eps output with xplot or fsc_surface [message #61683 is a reply to message #61678] Mon, 28 July 2008 10:14 Go to previous message
humanumbrella is currently offline  humanumbrella
Messages: 52
Registered: June 2008
Member
On Jul 28, 12:55 pm, humanumbre...@gmail.com wrote:
> On Jul 28, 12:34 pm, David Fanning <n...@dfanning.com> wrote:
>
>
>
>> David Fanning writes:
>>> I've even fooled around this morning trying to write this
>>> output directly to a PostScript file using the method outlined
>>> in this article:
>
>>>   http://www.dfanning.com/ographics_tips/object_eps.html
>
>>> This results in a PostScript file that cannot be opened with
>>> either Photoshop or GhostView. (IDL 7.0.1 on Windows.)
>
>> Whoops! Pilot error. If I select a PostScript printer, it
>> helps a lot.
>
>> I still can't control the aspect ratio of the output, etc.
>> But at least the output is starting to resemble what I see
>> in IDL when I import it into ImageReady.
>
>> I'm waiting to see what Justin has come up with.
>
>> Cheers,
>
>> David
>> --
>> David Fanning, Ph.D.
>> Fanning Software Consulting, Inc.
>> Coyote's Guide to IDL Programming:http://www.dfanning.com/
>> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
>
> Hello,
>
> I'm still working on my portion of the solution, as far as getting
> what I want out of it, but the problem goes something like this:
>
> Let's say you want to save something to the file at 72 DPI.  This is
> the default resolution of looking at an image on the screen, so if you
> create a plot, save it at 72 DPI, then import it back into photoshop/
> ghostview/imageready, it will be the proper proportion, because it's
> mapping the screen dimensions which are in 72 DPI straight back to 72
> DPI, so the aspect ratio is preserved.
>
> However, when you go up in resolution, herein lies the problem.  In
> the XPLOT/FSC_SURFACE code, David is trying to perform the same
> operation with the same amount of real estate.  IE, trying to cram 300
> DPI into 640x480 results in a much, much smaller image.  However, if
> before we initialize the clipboard object, we redefine the dimensions
> of the window to what they SHOULD be, where the screen displaying X
> DPI where X > 72, all of a sudden magic happens.
>
> I am still refining this fix, but I didn't want you to have to wait
> forever. (:
>
> So, here's what I've come up with for now:
>
>  res = 72
>  IF filename NE '' THEN BEGIN
>  CASE whichFileType OF
>     'EPS-72' :begin
>       resolution = [2.54/72, 2.54/72] & res=72
>     end
>     'EPS-150':begin
>       resolution = [2.54/150, 2.54/150] & res=150
>     end
>     'EPS-300':begin
>       resolution = [2.54/300, 2.54/300] & res=300
>     end
>     'EPS-1200':begin
>       resolution = [2.54/1200, 2.54/1200] & res=1200
>     end
>     'EPS-2400':begin
>       resolution = [2.54/2400, 2.54/2400] & res=2400
>     end
>  ENDCASE
>  info.thisWindow->GetProperty, Dimensions=viewDimensions,
> Units=viewUnits
>
>  viewDimensions*=res/72
>
>  clipboard = Obj_New('IDLgrClipboard', Dimensions=viewDimensions,$
>    Resolution=resolution,Quality=2, units=viewUnits)
>      clipboard->Draw, info.plotView, /Postscript, /vector,
> Filename=filename

The above code creates a bigger image, and it comes back as the same
size as what you initially saved it as, but it is not necessarily more
detailed. I am continuing work on this and will report some more
findings (:
Re: eps output with xplot or fsc_surface [message #61685 is a reply to message #61683] Mon, 28 July 2008 09:55 Go to previous message
humanumbrella is currently offline  humanumbrella
Messages: 52
Registered: June 2008
Member
On Jul 28, 12:34 pm, David Fanning <n...@dfanning.com> wrote:
> David Fanning writes:
>> I've even fooled around this morning trying to write this
>> output directly to a PostScript file using the method outlined
>> in this article:
>
>>   http://www.dfanning.com/ographics_tips/object_eps.html
>
>> This results in a PostScript file that cannot be opened with
>> either Photoshop or GhostView. (IDL 7.0.1 on Windows.)
>
> Whoops! Pilot error. If I select a PostScript printer, it
> helps a lot.
>
> I still can't control the aspect ratio of the output, etc.
> But at least the output is starting to resemble what I see
> in IDL when I import it into ImageReady.
>
> I'm waiting to see what Justin has come up with.
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")

Hello,

I'm still working on my portion of the solution, as far as getting
what I want out of it, but the problem goes something like this:

Let's say you want to save something to the file at 72 DPI. This is
the default resolution of looking at an image on the screen, so if you
create a plot, save it at 72 DPI, then import it back into photoshop/
ghostview/imageready, it will be the proper proportion, because it's
mapping the screen dimensions which are in 72 DPI straight back to 72
DPI, so the aspect ratio is preserved.

However, when you go up in resolution, herein lies the problem. In
the XPLOT/FSC_SURFACE code, David is trying to perform the same
operation with the same amount of real estate. IE, trying to cram 300
DPI into 640x480 results in a much, much smaller image. However, if
before we initialize the clipboard object, we redefine the dimensions
of the window to what they SHOULD be, where the screen displaying X
DPI where X > 72, all of a sudden magic happens.

I am still refining this fix, but I didn't want you to have to wait
forever. (:

So, here's what I've come up with for now:

res = 72
IF filename NE '' THEN BEGIN
CASE whichFileType OF
'EPS-72' :begin
resolution = [2.54/72, 2.54/72] & res=72
end
'EPS-150':begin
resolution = [2.54/150, 2.54/150] & res=150
end
'EPS-300':begin
resolution = [2.54/300, 2.54/300] & res=300
end
'EPS-1200':begin
resolution = [2.54/1200, 2.54/1200] & res=1200
end
'EPS-2400':begin
resolution = [2.54/2400, 2.54/2400] & res=2400
end
ENDCASE
info.thisWindow->GetProperty, Dimensions=viewDimensions,
Units=viewUnits

viewDimensions*=res/72

clipboard = Obj_New('IDLgrClipboard', Dimensions=viewDimensions,$
Resolution=resolution,Quality=2, units=viewUnits)
clipboard->Draw, info.plotView, /Postscript, /vector,
Filename=filename
Re: eps output with xplot or fsc_surface [message #61686 is a reply to message #61685] Mon, 28 July 2008 09:34 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> I've even fooled around this morning trying to write this
> output directly to a PostScript file using the method outlined
> in this article:
>
> http://www.dfanning.com/ographics_tips/object_eps.html
>
> This results in a PostScript file that cannot be opened with
> either Photoshop or GhostView. (IDL 7.0.1 on Windows.)

Whoops! Pilot error. If I select a PostScript printer, it
helps a lot.

I still can't control the aspect ratio of the output, etc.
But at least the output is starting to resemble what I see
in IDL when I import it into ImageReady.

I'm waiting to see what Justin has come up with.

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: eps output with xplot or fsc_surface [message #61687 is a reply to message #61686] Mon, 28 July 2008 09:10 Go to previous message
humanumbrella is currently offline  humanumbrella
Messages: 52
Registered: June 2008
Member
On Jul 28, 11:23 am, David Fanning <n...@dfanning.com> wrote:
> Justin writes:
>> I'm getting a strange bug with eps output from David's xplot -- and I
>> was wondering if anyone else has found/fixed this issue?
>
>> Here's the deal, so when I have the size of the window is, for
>> example, 368x264 pixels --> then I choose output->EPS (300 DPI) --
>> then I import it into ImageReady --> and the image size is now
>> 84x48... Err?
>
>> Now, when I make the window size -> 1058x915, at 300 DPI it comes out
>> as 250x205
>
>> What is going on here?  I've added additional options to go even
>> higher DPI, and the problem seems to get worse.
>
>> Do I need to increase the dimensions that get passed in or something?
>
> Like pretty much everyone else who tries to get PostScript
> output from object graphics programs, I generally throw my
> hands up in the air in disgust. There is no rhyme or reason
> to it. It just flat out sucks.
>
> I've checked all the inputs to the IDLgrClipboard object
> that is outputting this XPLOT information to the file.
> It all conforms to the IDL documentation. I can't account
> for the sizes you see when you input this file. Even
> Photoshop is totally flummoxed by it.
>
> I've even fooled around this morning trying to write this
> output directly to a PostScript file using the method outlined
> in this article:
>
>   http://www.dfanning.com/ographics_tips/object_eps.html
>
> This results in a PostScript file that cannot be opened with
> either Photoshop or GhostView. (IDL 7.0.1 on Windows.)
>
> I can send the output directly to a printer, but I cannot control
> the size of the output, etc. It takes up the whole page and, of course,
> has the wrong aspect ratio.
>
> So, I'm as confused as you are. It is one of the eternal mysteries,
> I guess. :-(
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")

I have figured it out and fixed the problem, in a few minutes I will
make a post about it.
Re: eps output with xplot or fsc_surface [message #61689 is a reply to message #61687] Mon, 28 July 2008 08:23 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Justin writes:

> I'm getting a strange bug with eps output from David's xplot -- and I
> was wondering if anyone else has found/fixed this issue?
>
> Here's the deal, so when I have the size of the window is, for
> example, 368x264 pixels --> then I choose output->EPS (300 DPI) --
> then I import it into ImageReady --> and the image size is now
> 84x48... Err?
>
> Now, when I make the window size -> 1058x915, at 300 DPI it comes out
> as 250x205
>
> What is going on here? I've added additional options to go even
> higher DPI, and the problem seems to get worse.
>
> Do I need to increase the dimensions that get passed in or something?

Like pretty much everyone else who tries to get PostScript
output from object graphics programs, I generally throw my
hands up in the air in disgust. There is no rhyme or reason
to it. It just flat out sucks.

I've checked all the inputs to the IDLgrClipboard object
that is outputting this XPLOT information to the file.
It all conforms to the IDL documentation. I can't account
for the sizes you see when you input this file. Even
Photoshop is totally flummoxed by it.

I've even fooled around this morning trying to write this
output directly to a PostScript file using the method outlined
in this article:

http://www.dfanning.com/ographics_tips/object_eps.html

This results in a PostScript file that cannot be opened with
either Photoshop or GhostView. (IDL 7.0.1 on Windows.)

I can send the output directly to a printer, but I cannot control
the size of the output, etc. It takes up the whole page and, of course,
has the wrong aspect ratio.

So, I'm as confused as you are. It is one of the eternal mysteries,
I guess. :-(

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.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: Re: Summing an array.
Next Topic: Removing some but not all spaces in a string

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

Current Time: Fri Oct 10 11:28:31 PDT 2025

Total time taken to generate the page: 0.25570 seconds