MichaelChirico / r-bugs

A ⚠️read-only⚠️mirror of https://bugs.r-project.org/
20 stars 0 forks source link

[BUGZILLA #6763] postscript image problem #2084

Open MichaelChirico opened 4 years ago

MichaelChirico commented 4 years ago

From: jonathan_lees@<::CENSORED -- SEE ORIGINAL ON BUGZILLA::> 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


METADATA

MichaelChirico commented 4 years ago

From: paul murrell <R-bugs@<::CENSORED -- SEE ORIGINAL ON BUGZILLA::>> 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


METADATA

MichaelChirico commented 4 years ago

From: Jonathan Lees <jonathan_lees@<::CENSORED -- SEE ORIGINAL ON BUGZILLA::>> 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 <CENSORING FROM DETECTED PHONE NUMBER ONWARDS; SEE BUGZILLA>


METADATA

MichaelChirico commented 4 years ago

From: Peter Kleiweg <kleiweg@<::CENSORED -- SEE ORIGINAL ON BUGZILLA::>> # aldus jonathan_lees@<::CENSORED -- SEE ORIGINAL ON BUGZILLA::> :

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/


METADATA

MichaelChirico commented 4 years ago

From: paul murrell <R-bugs@<::CENSORED -- SEE ORIGINAL ON BUGZILLA::>> 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


METADATA

MichaelChirico commented 4 years ago

NOTES: Spaces between squares in image() on some drivers.


METADATA

MichaelChirico commented 4 years ago

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


METADATA

MichaelChirico commented 4 years ago

I think this should probably be closed. Jonathan Lees wanted to make a high quality jpeg and I think that is possible currently without passing through postscript.


METADATA