Re: [Rd] png() and image()

From: Henrik Bengtsson <hb_at_stat.berkeley.edu>
Date: Fri 21 Jul 2006 - 16:35:14 GMT

Hi Wolfgang,

thanks for this - I took a look the EBImage webpage [http://www.ebi.ac.uk/~osklyar/projects/EBImage/] and it looks very nice. Are there any plans for Windows support too? I am looking for a cross-platform solution.

Cheers

Henrik

On 7/21/06, Wolfgang Huber <huber@ebi.ac.uk> wrote:
>
> Hi Henrik,
> this does not directly answer your question, but you might be able to
> use the function write.image in the package EBImage (Bioconductor) to
> write matrices into image files (e.g. PNG or JPEG), this might be more
> flexible and also faster than what you're trying to do.
> Best wishes
> Wolfgang
> ------------------------------------------------------------------
> Wolfgang Huber EBI/EMBL Cambridge UK http://www.ebi.ac.uk/huber
>
> Henrik Bengtsson wrote:
> > Hi,
> >
> > I try to create PNG images of a certain size where each pixel
> > intensity corresponds to exactly one probe signal in an Affymetrix
> > array. I try to use png() and image() with zero margins to do this.
> > Example:
> >
> > z <- matrix(1:15, nrow=45, ncol=30)
> > png("large.png", height=nrow(z), width=ncol(z), bg="red")
> > par(mar=c(0,0,0,0))
> > image(z, col=gray.colors(16), axes=FALSE)
> > dev.off()
> >
> > z <- matrix(1:15, nrow=5, ncol=3)
> > png("tiny.png", height=nrow(z), width=ncol(z), bg="red")
> > par(mar=c(0,0,0,0))
> > image(z, col=gray.colors(16), axes=FALSE)
> > dev.off()
> >
> > The problem is that on WinXP the very bottom row and the very right
> > column of pixels in red. Trying on Linux, it is only the very right
> > column that is red. See attached images (you might have to zoom in to
> > see it). I try to do this in R v2.3.1. The same effect is seen if
> > the jpeg() device is used.
> >
> > When rescaling, the same effect is seen (the red border effect is one
> > pixel wide), e.g.
> >
> > z <- matrix(1:15, nrow=45, ncol=30)
> > png("large5.png", height=5*nrow(z), width=5*ncol(z), bg="red")
> > par(mar=c(0,0,0,0))
> > image(z, col=gray.colors(16), axes=FALSE)
> > dev.off()
> >
> > I might be asking for something that is not supported, but is there a
> > way around this? It is a problem, because I wish to tile the images
> > in an HTML page.
> >
> > Thanks
> >
> > Henrik
> >
>



R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Sat Jul 22 02:38:21 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Mon 24 Jul 2006 - 12:30:28 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.