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

Home » Public Forums » archive » Re: IMDISP and writing to Postscript
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: IMDISP and writing to Postscript [message #65872] Sun, 29 March 2009 04:55 Go to next message
Jeremy Bailin is currently offline  Jeremy Bailin
Messages: 618
Registered: April 2008
Senior Member
On Mar 28, 5:24 pm, ed.schm...@gmail.com wrote:
> On Mar 27, 9:03 am, Brian Larsen <balar...@gmail.com> wrote:> Right I have learned that Preview.app lesson that hard way on more
>> than one occasion.  The ps file is fine is the pdf that is no good
>> that you are really viewing.
>
>> Instead of illustrator I find the easiest solution to use Acrobat
>> Distiller, I have it set as the default application for ps/eps files.
>
> Emily,
>
> Two other ways of viewing .ps files under OSX are the Gimp and
> Photoshop Elements. I tried both of these with your 5x5 idl.ps file,
> and both of them display the image without any smoothing.
>
> Ed Schmahl
>
>> Double-click and it makes pdfs that look great.  Of course you have to
>> have acrobat pro to have this but if you do its a great solution.
>
>> Brian
>
>> ------------------------------------------------------------ --------------
>> Brian Larsen
>> Boston University
>> Center for Space Physicshttp://people.bu.edu/balarsen/Home/IDL
>
>

And there's always ghostview! Still the fastest way of looking at a ps
file that I know of in OSX.

-Jeremy.
Re: IMDISP and writing to Postscript [message #65873 is a reply to message #65872] Sat, 28 March 2009 14:24 Go to previous messageGo to next message
ed.schmahl is currently offline  ed.schmahl
Messages: 11
Registered: October 2008
Junior Member
On Mar 27, 9:03 am, Brian Larsen <balar...@gmail.com> wrote:
> Right I have learned that Preview.app lesson that hard way on more
> than one occasion.  The ps file is fine is the pdf that is no good
> that you are really viewing.
>
> Instead of illustrator I find the easiest solution to use Acrobat
> Distiller, I have it set as the default application for ps/eps files.
Emily,

Two other ways of viewing .ps files under OSX are the Gimp and
Photoshop Elements. I tried both of these with your 5x5 idl.ps file,
and both of them display the image without any smoothing.

Ed Schmahl

> Double-click and it makes pdfs that look great.  Of course you have to
> have acrobat pro to have this but if you do its a great solution.
>
> Brian
>
> ------------------------------------------------------------ --------------
> Brian Larsen
> Boston University
> Center for Space Physicshttp://people.bu.edu/balarsen/Home/IDL
Re: IMDISP and writing to Postscript [message #65884 is a reply to message #65873] Fri, 27 March 2009 10:07 Go to previous messageGo to next message
Christopher Thom is currently offline  Christopher Thom
Messages: 66
Registered: October 2006
Member
I've also run into preview conversion/smoothing problems. For a free
option, I've found that the "epstopdf", which comes with latex/Texlive
distributions does an excellent job of converting ps->pdf, maintaining
bounding boxes correctly and maintaining the rasterised nature of idl ps
output.

cheers
chris

ps -- this util is *not* the same as "eps2pdf", with which i've had
trouble maintaining correct bboxes.


Quoth Brian Larsen:

> Right I have learned that Preview.app lesson that hard way on more
> than one occasion. The ps file is fine is the pdf that is no good
> that you are really viewing.
>
> Instead of illustrator I find the easiest solution to use Acrobat
> Distiller, I have it set as the default application for ps/eps files.
> Double-click and it makes pdfs that look great. Of course you have to
> have acrobat pro to have this but if you do its a great solution.
>
> Brian
>
> ------------------------------------------------------------ --------------
> Brian Larsen
> Boston University
> Center for Space Physics
> http://people.bu.edu/balarsen/Home/IDL
>
Re: IMDISP and writing to Postscript [message #65892 is a reply to message #65884] Fri, 27 March 2009 08:03 Go to previous messageGo to next message
Brian Larsen is currently offline  Brian Larsen
Messages: 270
Registered: June 2006
Senior Member
Right I have learned that Preview.app lesson that hard way on more
than one occasion. The ps file is fine is the pdf that is no good
that you are really viewing.

Instead of illustrator I find the easiest solution to use Acrobat
Distiller, I have it set as the default application for ps/eps files.
Double-click and it makes pdfs that look great. Of course you have to
have acrobat pro to have this but if you do its a great solution.






Brian

------------------------------------------------------------ --------------
Brian Larsen
Boston University
Center for Space Physics
http://people.bu.edu/balarsen/Home/IDL
Re: IMDISP and writing to Postscript [message #65893 is a reply to message #65892] Fri, 27 March 2009 07:40 Go to previous messageGo to next message
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article
<589acce4-7628-428f-bc07-41d7d57b1ad0@u39g2000pru.googlegroups.com>,
mooner <Emily.Wisnioski@gmail.com> wrote:

> Thanks to everyone! As you guessed I was using IDL on OSX and viewing
> my image in Preview.app
>
> I have tried Liam's fix and it works great (right now the largest
> images I am printing are ~20x20) but I will give ImageMagick a try for
> a more permanent fix.
>
> Thanks again for the comments
>
> Cheers,
> Emily

As Liam says, Preview seems to always smooth images. The Adobe apps don't.
(At least Illustrator does not.)

Ken Bowman
Re: IMDISP and writing to Postscript [message #65903 is a reply to message #65893] Thu, 26 March 2009 20:00 Go to previous messageGo to next message
mooner is currently offline  mooner
Messages: 3
Registered: March 2009
Junior Member
Thanks to everyone! As you guessed I was using IDL on OSX and viewing
my image in Preview.app

I have tried Liam's fix and it works great (right now the largest
images I am printing are ~20x20) but I will give ImageMagick a try for
a more permanent fix.

Thanks again for the comments

Cheers,
Emily
Re: IMDISP and writing to Postscript [message #65904 is a reply to message #65903] Thu, 26 March 2009 19:39 Go to previous messageGo to next message
liamgumley is currently offline  liamgumley
Messages: 74
Registered: June 2005
Member
On Mar 26, 7:13 pm, mooner <Emily.Wisnio...@gmail.com> wrote:
> Hi, I am using IDL to display some data. I find IMDISP to be perfect
> for this and it works great in 'x' windows. My image is (forgive me,
> I'm not quite sure how to describe this) is low resolution and I want
> it to be displayed as individual squares (of different colors) which
> IDL happily does in my x window. However when I write to postscript
> the image is 'blured' (I don't get well defined flat squares). I've
> played with all the keywords in device and imdsp but with no luck.
>
> Any suggestions?
>
> Cheers,
> Emily

Emily,

I can confirm that when your code sample is run in IDL 6.4 on OS X,
and the PostScript file is viewed with Preview.app, the image is
indeed smoothed. It appears to be happening in Preview when the
Postscript file is converted to PDF. I'm guessing that the same thing
will happen regardless of the IDL code used to display the image.

Here is a workaround, perhaps it will meet your needs. If your image
is truly small (less than 10 rows by 10 columns), you could always do
something like this:

nx = 5
ny = 5
a = findgen(nx, ny) ; original image
b = rebin(a, 100 * nx, 100 * ny, /sample) ; resampled image
loadct, 13
imdisp, b
pson, file='test.ps'
imdisp, b
psoff

The resampled image in test.ps will show the blockiness present in the
original image, since the resampled image is created via pixel
replication. Note that I've used imdisp.pro, pson.pro and psoff.pro
from

http://gumley.com/PIP/Sample_Programs/PIP_programs.zip

Cheers,
Liam.
Practical IDL Programming
http://www.gumley.com/
Re: IMDISP and writing to Postscript [message #65907 is a reply to message #65904] Thu, 26 March 2009 18:44 Go to previous messageGo to next message
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article
<1d467701-8eca-481f-8b5c-23cb77dc7690@u9g2000pre.googlegroups.com>,
mooner <Emily.Wisnioski@gmail.com> wrote:

> If I exlucde the postscipt and plot in an x window I get a 5X5 box
> with 25 individual squares. But when I plot to postscript the
> individual squares are blended, appearing like a gradient with more
> than 25 colors.
>
> Emily

What application and OS are you using to view the Postscript file?

Ken Bowman
Re: IMDISP and writing to Postscript [message #65908 is a reply to message #65907] Thu, 26 March 2009 18:49 Go to previous messageGo to next message
mankoff is currently offline  mankoff
Messages: 131
Registered: March 2004
Senior Member
On Mar 26, 8:13 pm, mooner <Emily.Wisnio...@gmail.com> wrote:
> Hi, I am using IDL to display some data. I find IMDISP to be perfect
> for this and it works great in 'x' windows. My image is (forgive me,
> I'm not quite sure how to describe this) is low resolution and I want
> it to be displayed as individual squares (of different colors) which
> IDL happily does in my x window. However when I write to postscript
> the image is 'blured' (I don't get well defined flat squares). I've
> played with all the keywords in device and imdsp but with no luck.
>
> Any suggestions?
>
> Cheers,
> Emily

Emily,

Are you on OS X? Are you viewing PostScript or is Preview.app
converting to PDF? On some versions of OS X the ghostscript converter
smooths images. Printed graphics still look blocky, and ImageMagick
(convert foo.ps foo.png) produces correct output.

-k.
Re: IMDISP and writing to Postscript [message #65910 is a reply to message #65907] Thu, 26 March 2009 18:13 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
mooner writes:

> Sure, for example:
>
> set_plot, 'PS'
> device, /color, bits_per_pixel=3D8, filename=3Doutname+'.ps'
> loadct, 13
> imdisp, findgen(5,5)
> device, /close
>
> If I exlucde the postscipt and plot in an x window I get a 5X5 box
> with 25 individual squares. But when I plot to postscript the
> individual squares are blended, appearing like a gradient with more
> than 25 colors.

Yeah, I don't know. That is exactly what I did. I see
25 individual squares in both. Strange.

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: IMDISP and writing to Postscript [message #65911 is a reply to message #65910] Thu, 26 March 2009 17:42 Go to previous messageGo to next message
mooner is currently offline  mooner
Messages: 3
Registered: March 2009
Junior Member
On Mar 27, 11:31 am, David Fanning <n...@dfanning.com> wrote:
> mooner writes:
>> Hi, I am using IDL to display some data. I find IMDISP to be perfect
>> for this and it works great in 'x' windows. My image is (forgive me,
>> I'm not quite sure how to describe this) is low resolution and I want
>> it to be displayed as individual squares (of different colors) which
>> IDL happily does in my x window. However when I write to postscript
>> the image is 'blured' (I don't get well defined flat squares). I've
>> played with all the keywords in device and imdsp but with no luck.
>
>> Any suggestions?
>
> Humm. Sure you are using the latest version? It certainly
> doesn't do that for me. Maybe we could see the code
> you are using.
>
> 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.")

Sure, for example:

set_plot, 'PS'
device, /color, bits_per_pixel=8, filename=outname+'.ps'
loadct, 13
imdisp, findgen(5,5)
device, /close

If I exlucde the postscipt and plot in an x window I get a 5X5 box
with 25 individual squares. But when I plot to postscript the
individual squares are blended, appearing like a gradient with more
than 25 colors.

Emily
Re: IMDISP and writing to Postscript [message #65912 is a reply to message #65911] Thu, 26 March 2009 17:31 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
mooner writes:

> Hi, I am using IDL to display some data. I find IMDISP to be perfect
> for this and it works great in 'x' windows. My image is (forgive me,
> I'm not quite sure how to describe this) is low resolution and I want
> it to be displayed as individual squares (of different colors) which
> IDL happily does in my x window. However when I write to postscript
> the image is 'blured' (I don't get well defined flat squares). I've
> played with all the keywords in device and imdsp but with no luck.
>
> Any suggestions?

Humm. Sure you are using the latest version? It certainly
doesn't do that for me. Maybe we could see the code
you are using.

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: IMDISP and writing to Postscript [message #65960 is a reply to message #65872] Mon, 30 March 2009 10:05 Go to previous message
mankoff is currently offline  mankoff
Messages: 131
Registered: March 2004
Senior Member
On Mar 29, 7:55 am, Jeremy Bailin <astroco...@gmail.com> wrote:
> On Mar 28, 5:24 pm, ed.schm...@gmail.com wrote:
>
>
>
>> On Mar 27, 9:03 am, Brian Larsen <balar...@gmail.com> wrote:> Right I have learned that Preview.app lesson that hard way on more
>>> than one occasion.  The ps file is fine is the pdf that is no good
>>> that you are really viewing.
>
>>> Instead of illustrator I find the easiest solution to use Acrobat
>>> Distiller, I have it set as the default application for ps/eps files.
>
>> Emily,
>
>> Two other ways of viewing .ps files under OSX are the Gimp and
>> Photoshop Elements. I tried both of these with your 5x5 idl.ps file,
>> and both of them display the image without any smoothing.
>
>> Ed Schmahl
>
>>> Double-click and it makes pdfs that look great.  Of course you have to
>>> have acrobat pro to have this but if you do its a great solution.
>
>>> Brian
>
>>> ------------------------------------------------------------ --------------
>>> Brian Larsen
>>> Boston University
>>> Center for Space Physicshttp://people.bu.edu/balarsen/Home/IDL
>
> And there's always ghostview! Still the fastest way of looking at a ps
> file that I know of in OSX.
>
> -Jeremy.

Yes. Finally usable too. Do you install via fink or some other
method?

About a year or two ago the fink gv required installing all of gnome.
What a bizarre waste of space and dependencies. Your post made me re-
check it and it appears gv is now slim again, and a new package ggv
exists which includes gnome.

gv has the beautiful feature of 'watching' a file, so you can re-
create and fine-tune your postscript file while leaving gv running to
the side or on a second monitor and see your changes in realtime.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: How to programmatically access the Available Band List
Next Topic: Maps and interpolation w/ invalid data points

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

Current Time: Wed Oct 08 13:58:31 PDT 2025

Total time taken to generate the page: 0.00509 seconds