Re: IMDISP and writing to Postscript [message #65904 is a reply to message #65903] |
Thu, 26 March 2009 19:39   |
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/
|
|
|