Discussion:
Blurred display of images in PDFs created from EPS on Mac OS X
(too old to reply)
j***@dmu.ac.uk
2005-02-03 17:03:44 UTC
Permalink
I often make false colour maps of data in IDL and export as EPS
graphics which I used to import into FrameMaker documents. I have
recently migrated from Solaris to Mac OS X and plan to use Pages and
Keynote (I know, Pages is not a FrameMaker replacement, but that
another story.) Anyway, there is an irritating quirk in the way Mac OS
X displays the PDFs created from EPS files - the image embedded in the
graphic (say, a 20 by 20 array) is displayed upsampled and horribly
blurred. This is the case in Preview and Keynote, but not Acrobat 7
which shows it nice and crisp. Keynote shows the PDF image blurred in
editing and as a slide-show, but it does export a sharp PDF. Whilst
this is workable, it does mean not using the native Keynote slide-show
mode.

This is evidently a Mac OS X quirk, rather than anything to do with
IDL. However, despite some searching, I can't find any mention of it
any of the Apple lists etc. Furthermore, it may be something that only
occurs with arrays (i.e. images) embedded in EPS files - something IDL
users are likely to produce, which is why I've posted here.

Any ideas?

-John Mardaljevic
David Fanning
2005-02-03 17:12:00 UTC
Permalink
Post by j***@dmu.ac.uk
I often make false colour maps of data in IDL and export as EPS
graphics which I used to import into FrameMaker documents. I have
recently migrated from Solaris to Mac OS X and plan to use Pages and
Keynote (I know, Pages is not a FrameMaker replacement, but that
another story.) Anyway, there is an irritating quirk in the way Mac OS
X displays the PDFs created from EPS files - the image embedded in the
graphic (say, a 20 by 20 array) is displayed upsampled and horribly
blurred. This is the case in Preview and Keynote, but not Acrobat 7
which shows it nice and crisp. Keynote shows the PDF image blurred in
editing and as a slide-show, but it does export a sharp PDF. Whilst
this is workable, it does mean not using the native Keynote slide-show
mode.
This is evidently a Mac OS X quirk, rather than anything to do with
IDL. However, despite some searching, I can't find any mention of it
any of the Apple lists etc. Furthermore, it may be something that only
occurs with arrays (i.e. images) embedded in EPS files - something IDL
users are likely to produce, which is why I've posted here.
Any ideas?
I think you are going to have to figure out how to get a better
preview image into your EPS file. Here are some ideas:

http://www.dfanning.com/tips/postscript_preview.html

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
j***@dmu.ac.uk
2005-02-03 19:17:05 UTC
Permalink
David,

I don't think it's anything to do with a preview image - the graphic is
PDF distilled from the postscript.

-John
Ben Tupper
2005-02-04 13:58:41 UTC
Permalink
Post by j***@dmu.ac.uk
David,
I don't think it's anything to do with a preview image - the graphic is
PDF distilled from the postscript.
-John
Hi,

I haven't done much with image output to PS on Mac OSX but I have been quite
pleased with plots etc. These I have converted to PDF using pstopdf with nice
results. Could you provide a small example of code that produces you postscript
output so we could see the blurring?

Ben
j***@dmu.ac.uk
2005-02-04 15:36:57 UTC
Permalink
Ben,

The code is not the problem; it's an OSX quirk. Image smoothing seems
to be built-in to Aqua.
There's nothing wrong with the PDFs produced by OSX apps (other than
being a bit bloated
compared to Adobe distilled PDFs). In fact, in this example screen
grab:

Loading Image...

the EPS was converted to PDF using the Preview application - which
shows it here mushy.
The false colour map (byte-scaled array) is displayed (written to the
Postscript device)
using TV just like any other image. It just happens to have small
pixel dimensions.

The mushy lower image is what the PDF looks like in Keynote also. The
upper is how it
should look (displayed here in Acrobat). Frustratingly, if you hold
down the mouse
whilst resizing in Keynote the image looks OK... until you let go of
the mouse button
and the smoothing mushes up the image again. PDFs created by Keynote
are fine (just as
they are with Preview). But it rules out using native Keynote for a
presentation - which is
a pity (unless I can turn the smoothing off).

Niggles aside, the transition from Solaris to OSX has been a joy. The
only application I miss
having is Framemaker.

Regards,

-John Mardaljevic
Edd Edmondson
2005-02-07 13:17:57 UTC
Permalink
Post by j***@dmu.ac.uk
Ben,
The code is not the problem; it's an OSX quirk. Image smoothing seems
to be built-in to Aqua.
There's nothing wrong with the PDFs produced by OSX apps (other than
being a bit bloated
compared to Adobe distilled PDFs). In fact, in this example screen
Yeah, I can see what you mean. Have you tried exporting to a high
resolution bitmap?

Obviously you lose some quality by doing so (eg in any vector-based stuff
like text), but if you're using it only for a presentation then you can
pick an appropriate resolution for it.

Not an ideal solution but it should be workable.
--
Edd
j***@dmu.ac.uk
2005-02-07 14:05:17 UTC
Permalink
That would be a last resort. I'd hope that maybe there will some
option
introduced at a later date (Tiger?).

As Acrobat displays it fine, I guess it's "hard-wired" into
applications at
present. Adobe seem to have diverged a little from Apple's default
imaging model - if so, I can see why.

Here's the original PDF if anyone wants to try out any ideas - view it
in both Acrobat and any of Preview/Keynote/Pages:

http://www.iesd.dmu.ac.uk/~jm/pickup/lum_int093_92_12h00.pdf

I don't think it's anything to do with how the PDF was created.
It's 'simply' Aqua is trying to be helpful: "Here is a graphic
comprised
of only a fews tens of image (i.e. scaleable postscript) pixels shown
using tens of thousands of (LCD) display pixels - I will smooth it out
to look *nicer*".

-John
Karl Schultz
2005-02-07 16:32:41 UTC
Permalink
Post by j***@dmu.ac.uk
That would be a last resort. I'd hope that maybe there will some
option
introduced at a later date (Tiger?).
As Acrobat displays it fine, I guess it's "hard-wired" into
applications at
present. Adobe seem to have diverged a little from Apple's default
imaging model - if so, I can see why.
Here's the original PDF if anyone wants to try out any ideas - view it
http://www.iesd.dmu.ac.uk/~jm/pickup/lum_int093_92_12h00.pdf
I don't think it's anything to do with how the PDF was created.
It's 'simply' Aqua is trying to be helpful: "Here is a graphic
comprised
of only a fews tens of image (i.e. scaleable postscript) pixels shown
using tens of thousands of (LCD) display pixels - I will smooth it out
to look *nicer*".
-John
This discussion was also posted to uk.com.sys.mac where a
promising-looking solution involving creating a PDF workflow with image
interpolation turned off is discussed.

Karl
j***@dmu.ac.uk
2005-02-07 16:50:38 UTC
Permalink
Didn't work for me. Also, just made a PDF from the EPS using Adobe
Distiller. No change.
Karl Schultz
2005-02-07 18:50:51 UTC
Permalink
Post by j***@dmu.ac.uk
Didn't work for me. Also, just made a PDF from the EPS using Adobe
Distiller. No change.
OK, another item to investigate is to run the ColorSync utility. I
noticed that there is a filter setting that controls PDF image
interpolation. I do not know how to get this filter setting applied when
using Preview, but I bet the answer is in this area.

Karl
Karl Schultz
2005-02-07 16:39:48 UTC
Permalink
Post by j***@dmu.ac.uk
I don't think it's anything to do with how the PDF was created.
It's 'simply' Aqua is trying to be helpful: "Here is a graphic
comprised
of only a fews tens of image (i.e. scaleable postscript) pixels shown
using tens of thousands of (LCD) display pixels - I will smooth it out
to look *nicer*".
This discussion was posted to uk.comp.sys.mac where there is a solution
offered involving changing the PDF workflow to turn off image
interpolation.

Karl
Edd Edmondson
2005-02-07 16:49:41 UTC
Permalink
Post by Karl Schultz
Post by j***@dmu.ac.uk
I don't think it's anything to do with how the PDF was created.
It's 'simply' Aqua is trying to be helpful: "Here is a graphic
comprised
of only a fews tens of image (i.e. scaleable postscript) pixels shown
using tens of thousands of (LCD) display pixels - I will smooth it out
to look *nicer*".
This discussion was posted to uk.comp.sys.mac where there is a solution
offered involving changing the PDF workflow to turn off image
interpolation.
That doesn't work for me.
--
Edd
Edd Edmondson
2005-02-07 17:00:02 UTC
Permalink
Post by j***@dmu.ac.uk
That would be a last resort. I'd hope that maybe there will some
option
introduced at a later date (Tiger?).
http://www.apple.com/macosx/feedback/ - make sure you tell them you want
it!
--
Edd
Norbert Hahn
2005-02-07 16:17:03 UTC
Permalink
Post by j***@dmu.ac.uk
The false colour map (byte-scaled array) is displayed (written to the
Postscript device)
using TV just like any other image. It just happens to have small
pixel dimensions.
Maybe your program mis-interprets some PostScript elements, such
as pixmaps? If I understand PS correctly there is no such thing
as a pixel on the input side of PS. A bitmap fed into PS is an
area which has to be filled with scalable rectangles. When printing
the PS engine (of course) has to translate the rectangles into
device pixels, and it might apply some low pass filtering to avoid
moiree.

Maybe the PS generator of IDL did something to fool your program.
I used the following program for a check:

IDL> set_plot, "PS"
IDL> tvscl, dist(20,30), xsize=5, ysize=5, /inch
% Compiled module: DIST.
IDL> exit

That resulted in PS code that looks like (the comment lines
are my interpretation):

%% Setup scaling 72/2540 as needed for a device with 2450 DPI res.
$IDL_DICT begin 54 360 translate 0.0283465 dup scale

%% Scale a 20x30 bitmap to 5x5 inch ( 12700 pixel on output)
12699 12699 scale 20 30 4 [20 0 0 30 0 0]

%% use the image operator to input the matrix
/J { currentfile picstr readhexstring pop} bdef
{J} image
001234567787765432100112345678887654321111233456789876543321223
[snipped]

... which looks correct to me.

How did you define the size of the area that TV should fill in?

Regards,
Norbert
j***@dmu.ac.uk
2005-02-07 16:47:34 UTC
Permalink
Post by Norbert Hahn
Maybe your program mis-interprets some PostScript elements, such
as pixmaps?
It's more something fundamental to the display system in OSX.
Post by Norbert Hahn
How did you define the size of the area that TV should fill in?
Much as you did, only in cm. Am I right in guessing that you're not
using
OSX? I hope there's a few OSX users out there that repeat this quirk
with
their own code. Better still if they could show that it's *me* that's
not getting
it right....

-John
Edd Edmondson
2005-02-07 16:57:31 UTC
Permalink
Post by j***@dmu.ac.uk
Post by Norbert Hahn
How did you define the size of the area that TV should fill in?
Much as you did, only in cm. Am I right in guessing that you're not
using
OSX? I hope there's a few OSX users out there that repeat this quirk
with
their own code. Better still if they could show that it's *me* that's
not getting
it right....
I can confirm it using your pdf and I can also see it in other images I've
created at very high zooms. It's nothing you're doing wrong that I can
see.

Maybe if you tried upsampling the array you use within IDL, so that each
'pixel' in the plot is blown up to an n by n grid all of the same colour?
That may persuade OS X to at least use narrow regions to interpolate over.
--
Edd
j***@dmu.ac.uk
2005-02-07 18:12:56 UTC
Permalink
Post by Edd Edmondson
I can confirm it using your pdf and I can also see it in other images I've
created at very high zooms. It's nothing you're doing wrong that I can
see.
Maybe if you tried upsampling the array you use within IDL, so that each
'pixel' in the plot is blown up to an n by n grid all of the same colour?
That may persuade OS X to at least use narrow regions to interpolate over.
Thanks for trying it out. Yes, the upsampling did occur to me. Though
I
must admit the 'purist' in me thought that was too high a price to pay
just to
use the gee-whizz transitions in Keynote. I can still use Keynote to
make PDFs.
Heck, I'm even thinking of moving to Tex (TexShop) since Framemaker on
OSX
is not an option. Can't get more 'purist' than that.

Thanks again,

-John
Norbert Hahn
2005-02-08 09:36:22 UTC
Permalink
Post by j***@dmu.ac.uk
Post by Norbert Hahn
Maybe your program mis-interprets some PostScript elements, such
as pixmaps?
It's more something fundamental to the display system in OSX.
I hope it is not but rather a feature of the program you use.
Post by j***@dmu.ac.uk
Post by Norbert Hahn
How did you define the size of the area that TV should fill in?
Much as you did, only in cm. Am I right in guessing that you're not
using
OSX?
I used Windows XP for that to find out what elements of PostScript
are used by IDL. The IDL plotting devices (PS is one of them) does
not depend on the operating system, so I'm pretty sure that if
IDL translates TV into the PS image operator (using Windows XP)
it will do so using OSX.

I tried a couple of PS interpreters to find how they in turn handle
the image operator and all of them filled the rectangles specified
by image with constant color. No interpolation occured.
Post by j***@dmu.ac.uk
I hope there's a few OSX users out there that repeat this quirk
with
their own code. Better still if they could show that it's *me* that's
not getting
it right....
So you should contact the author/service team/who ever of the program
that causes the image operator to interpolate.

Norbert
j***@dmu.ac.uk
2005-02-08 12:16:17 UTC
Permalink
Post by Norbert Hahn
So you should contact the author/service team/who ever of the program
that causes the image operator to interpolate.
I've logged it with Apple using their feedback form (the 'program' as
such is
the Aqua/OSX display system).

-John
Kenneth P. Bowman
2005-02-09 02:50:03 UTC
Permalink
Post by j***@dmu.ac.uk
Post by Norbert Hahn
So you should contact the author/service team/who ever of the program
that causes the image operator to interpolate.
I've logged it with Apple using their feedback form (the 'program' as
such is
the Aqua/OSX display system).
-John
I sent an example to my local Apple customer engineer. He can see that
Adobe Reader (for example) and Apple programs such as Preview and
Keynote display images differently (both on OS X). He is sending a
request up the chain to have the image smoothing turned off, or at least
made optional.

Ken Bowman
j***@dmu.ac.uk
2005-02-09 10:22:12 UTC
Permalink
Post by Kenneth P. Bowman
I sent an example to my local Apple customer engineer. He can see that
Adobe Reader (for example) and Apple programs such as Preview and
Keynote display images differently (both on OS X). He is sending a
request up the chain to have the image smoothing turned off, or at least
made optional.
Thanks, Ken. I think someone at RSI may also bring it to Apple's
attention.
I'm sure that it will take a few nudges to get this noticed by Apple.

-John Mardaljevic
Kenneth Bowman
2005-02-09 19:04:24 UTC
Permalink
Post by j***@dmu.ac.uk
Thanks, Ken. I think someone at RSI may also bring it to Apple's
attention.
I'm sure that it will take a few nudges to get this noticed by Apple.
-John Mardaljevic
I think the best approach is to tell Apple "I can't use Keynote for
scientific presentations because it blurs my scientific graphics."

;-)

Ken

Loading...