Bug 6763 - postscript image problem
Summary: postscript image problem
Status: NEW
Alias: None
Product: R
Classification: Unclassified
Component: Graphics (show other bugs)
Version: old
Hardware: All Linux
: P5 normal
Assignee: Jitterbug compatibility account
URL:
Depends on:
Blocks:
 
Reported: 2004-04-14 02:38 UTC by Jitterbug compatibility account
Modified: 2004-04-29 08:16 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jitterbug compatibility account 2004-04-14 02:38:56 UTC
From: jonathan_lees@unc.edu
Full_Name: Jonathan Lees
Version: 1.8.1
OS: GNU/Linux   2.4.20-20.8smp #1 SMP
Submission from: (NULL) (152.2.75.114)


I am having trouble with the postscript output of images.
They have lines on them that are not supposed to be there.
I have noticed this on numerous trials of printing various images.
I looked at the postscript and I see that it
appears to plot each individual block - so perhaps occasionally the 
space between the blocks "leaks" through do to round off,
thus contaminating the image.
this could be solved if the image software used postscript
image plotting functions.

Here is an example of some code:

postscript(file ="test.ps" , onefile=FALSE, print.it=FALSE)


w<-5 #width of central square
m=w
xn<- 128; yn<- 128
im<- matrix(0,nrow=yn,ncol=xn)
xc<-floor(xn/2)+1;
yc<- floor(yn/2)+1 # centers of the image
im[(-m:m)+xc,(-m:m)+yc]<- 1

image(im , col = cmap ); title('im=Original image')


dev.off()

view this output with any postscript viewer (or printer)
and you will see extra lines on the plot.

Does this bother anyone else?

Joanthan Lees





Comment 1 Jitterbug compatibility account 2004-04-28 08:57:12 UTC
From: paul murrell <R-bugs@biostat.ku.dk>
Hi


> Full_Name: Jonathan Lees
> I am having trouble with the postscript output of images.
> They have lines on them that are not supposed to be there.
> I have noticed this on numerous trials of printing various images.
> I looked at the postscript and I see that it
> appears to plot each individual block - so perhaps occasionally the 
> space between the blocks "leaks" through do to round off,
> thus contaminating the image.
> this could be solved if the image software used postscript
> image plotting functions.
> 
> Here is an example of some code:
> 
> postscript(file ="test.ps" , onefile=FALSE, print.it=FALSE)
> 
> 
> w<-5 #width of central square
> m=w
> xn<- 128; yn<- 128
> im<- matrix(0,nrow=yn,ncol=xn)
> xc<-floor(xn/2)+1;
> yc<- floor(yn/2)+1 # centers of the image
> im[(-m:m)+xc,(-m:m)+yc]<- 1
> 
> image(im , col = cmap ); title('im=Original image')
> 
> 
> dev.off()
> 
> view this output with any postscript viewer (or printer)
> and you will see extra lines on the plot.



Is this just caused by antialiasing on the postscript viewer.  I see this with
anti-aliasing on, but it goes away if I turn antialiasing off.  Of course, that
wouldn't explain the effect when a document is printed, but I don't get that.

Paul
Comment 2 Jitterbug compatibility account 2004-04-28 17:06:17 UTC
From: Jonathan Lees <jonathan_lees@unc.edu>
It is true that if you turn antialiasing
off on GV then the effect seems to disappear but that is just a cosmetic 
thing.
Other aspects of the figure are subsequently degraded, however.

I am really interested in converting the postscript to good JPEG images and
I can't get rid of the annoying lines when I use display or
convert (in LINUX).
If I could figure our how to get a good JPEG figure I would be
satisfied.

Thanks for any help.




paul murrell wrote:

>Hi
>
>
>  
>
>>Full_Name: Jonathan Lees
>>I am having trouble with the postscript output of images.
>>They have lines on them that are not supposed to be there.
>>I have noticed this on numerous trials of printing various images.
>>I looked at the postscript and I see that it
>>appears to plot each individual block - so perhaps occasionally the 
>>space between the blocks "leaks" through do to round off,
>>thus contaminating the image.
>>this could be solved if the image software used postscript
>>image plotting functions.
>>
>>Here is an example of some code:
>>
>>postscript(file ="test.ps" , onefile=FALSE, print.it=FALSE)
>>
>>
>>w<-5 #width of central square
>>m=w
>>xn<- 128; yn<- 128
>>im<- matrix(0,nrow=yn,ncol=xn)
>>xc<-floor(xn/2)+1;
>>yc<- floor(yn/2)+1 # centers of the image
>>im[(-m:m)+xc,(-m:m)+yc]<- 1
>>
>>image(im , col = cmap ); title('im=Original image')
>>
>>
>>dev.off()
>>
>>view this output with any postscript viewer (or printer)
>>and you will see extra lines on the plot.
>>    
>>
>
>
>Is this just caused by antialiasing on the postscript viewer.  I see this with
>anti-aliasing on, but it goes away if I turn antialiasing off.  Of course, that
>wouldn't explain the effect when a document is printed, but I don't get that.
>
>Paul
>  
>

-- 
===============================
Jonathan M. Lees
Associate Professor
University of North Carolina
Department of Geological Sciences
CB#3315, Mitchell Hall
Chapel Hill, NC 27599-3315

VOICE: (919) 962-0695
FAX:   (919) 966-4519

EMAIL: jonathan.lees@unc.edu
http://www.unc.edu/~leesj





Comment 3 Jitterbug compatibility account 2004-04-28 17:35:48 UTC
From: Peter Kleiweg <kleiweg@let.rug.nl>
# aldus jonathan_lees@unc.edu :

> I am really interested in converting the postscript to good JPEG images and
> I can't get rid of the annoying lines when I use display or
> convert (in LINUX).
> If I could figure our how to get a good JPEG figure I would be
> satisfied.


http://odur.let.rug.nl/~kleiweg/postscript/postscript.html#conversion




-- 
Peter Kleiweg
http://www.let.rug.nl/~kleiweg/

Comment 4 Jitterbug compatibility account 2004-04-29 08:16:44 UTC
From: paul murrell <R-bugs@biostat.ku.dk>
Hi


> It is true that if you turn antialiasing
> off on GV then the effect seems to disappear but that is just a cosmetic 
> thing.
> Other aspects of the figure are subsequently degraded, however.



Just for the record, I'm afraid this problem won't be fixed in a hurry from
within R.  
R's graphics passes through a common "engine" before being sent to a particular
device and this engine has a pretty lowest-common-denominator approach.  For
example, the engine has no separate "image" primitive - it only knows about
things like lines, text, rectangles, ...  This is why the output from the
image() function is produced using lots of rectangles in postscript (rather than
anything more sophisticated/sensible).

Paul
Comment 5 Jitterbug compatibility account 2005-03-29 21:51:00 UTC
NOTES:
 Spaces between squares in image() on some drivers.
Comment 6 Jitterbug compatibility account 2005-03-29 23:50:55 UTC
Audit (from Jitterbug):
Fri Apr 16 18:25:47 2004	ripley	moved from incoming to Graphics
Tue Apr 27 23:57:12 2004	paul	sent reply 1
Wed Apr 28 23:16:44 2004	paul	sent reply 2
Tue Mar 29 17:50:55 2005	thomas	changed notes