Re: [R] bmp() shifts the image (Windows XP)

2012-01-02 Thread Ben Tupper
Hi, On Jan 2, 2012, at 7:00 AM, William Simpson wrote: > Duncan, I checked out as.raster as you suggested. However, I can't > find info on how to display and save a raster object. What a raster > object is eludes me. These were fruitless > ?as.raster > ?grDevices > library(help="grDevices") > ?wi

Re: [R] bmp() shifts the image (Windows XP)

2012-01-02 Thread William Simpson
I have figured out what I wanted to do using pixmap. Pixmap writes .pgm files which I will batch convert to .bmp using Irfanview. Thanks for your help. Cheers, Bill On 1/2/12, William Simpson wrote: > Duncan, I checked out as.raster as you suggested. However, I can't > find info on how to displ

Re: [R] bmp() shifts the image (Windows XP)

2012-01-02 Thread William Simpson
Duncan, I checked out as.raster as you suggested. However, I can't find info on how to display and save a raster object. What a raster object is eludes me. These were fruitless ?as.raster ?grDevices library(help="grDevices") ?windows ?savePlot x<-as.raster(matrix(runif(n*n),nrow=n)) How to d

Re: [R] bmp() shifts the image (Windows XP)

2012-01-02 Thread William Simpson
Thanks Duncan for your help. Bill On 1/1/12, Duncan Murdoch wrote: > On 12-01-01 9:05 AM, William Simpson wrote: >> When using bmp() under Windows XP, I find that the saved image is a >> shifted version of the correct image. Try this: > > The image() function isn't designed to be able to do pixel

Re: [R] bmp() shifts the image (Windows XP)

2012-01-01 Thread Duncan Murdoch
On 12-01-01 9:05 AM, William Simpson wrote: When using bmp() under Windows XP, I find that the saved image is a shifted version of the correct image. Try this: The image() function isn't designed to be able to do pixel-level addressing, so it's not too surprising that some rounding error some

[R] bmp() shifts the image (Windows XP)

2012-01-01 Thread William Simpson
When using bmp() under Windows XP, I find that the saved image is a shifted version of the correct image. Try this: n<-5 fn<-"01.bmp" x<-matrix(runif(n*n),nrow=n) image(x,col=gray(0:255/255),axes=F,frame.plot=F) bmp(filename = fn,width = n, height = n, units = "px") par(mar=c(0,0,0,0),pty="s") ima