Has anyone yet tried incorporating rasterImage into the base image() function? It seems to make a *huge* difference, with a very small number of added/changed lines of code. (Of course I have barely tested it at all.) Is there any reason this *shouldn't* go into the next release?> source("image.R") > z <- matrix(runif(1e6),nrow=1000) > image(z) > image(z,useRaster=TRUE)(Patch against SVN 54284 attached; people can contact me if it doesn't go through and they want it.) Ben Bolker -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: image_diff.txt URL: <https://stat.ethz.ch/pipermail/r-devel/attachments/20110208/723aa201/attachment.txt>
Hello, There's a problem for rasterImage when used in SDI mode in Windows, which may be worth considering. https://stat.ethz.ch/pipermail/r-sig-geo/2010-July/008820.html I had off-list emails with Duncan Murdoch and Paul Murrell about this and they determined that it was in SDI only, and there's still no resolution for it as far as I know. I checked in the latest dev build of 2.13.0 2011-02-04 r54221 just in case. This has been in use in the derived function image.SpatialGridDataFrame in the sp package since rasterImage was released, the sp function incorporates a warning for users in SDI mode. Cheers, Mike. On Wed, Feb 9, 2011 at 12:49 PM, Ben Bolker <bbolker at gmail.com> wrote:> > ?Has anyone yet tried incorporating rasterImage into the base image() > function? ?It seems to make a *huge* difference, with > a very small number of added/changed lines of code. ?(Of course I have > barely tested it at all.) > ?Is there any reason this *shouldn't* go into the next release? > >> source("image.R") >> z <- matrix(runif(1e6),nrow=1000) >> image(z) >> image(z,useRaster=TRUE) > > ?(Patch against SVN 54284 attached; people can contact me if it doesn't > go through and they want it.) > > ?Ben Bolker > > > ______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > >-- Michael Sumner Institute for Marine and Antarctic Studies, University of Tasmania Hobart, Australia e-mail: mdsumner at gmail.com
Ben, did you actually look at the result of your function with useRaster=TRUE ? ;) [Hint: don't use an image that is symmetric] Apart from that nice bug there are more issues as well, try image(matrix(1:4,2),col=1:3) The underlying issue is that as.raster() is not quite what you would hope. Unfortunately I'm not aware of an easy fix (that doesn't involve going back to RGB decomposition). In general, I think it's a nice option, but I don't think you'll get away with only a few lines... Cheers, Simon On Feb 8, 2011, at 8:49 PM, Ben Bolker wrote:> > Has anyone yet tried incorporating rasterImage into the base image() > function? It seems to make a *huge* difference, with > a very small number of added/changed lines of code. (Of course I have > barely tested it at all.) > Is there any reason this *shouldn't* go into the next release? > >> source("image.R") >> z <- matrix(runif(1e6),nrow=1000) >> image(z) >> image(z,useRaster=TRUE) > > (Patch against SVN 54284 attached; people can contact me if it doesn't > go through and they want it.) > > Ben Bolker > > <image_diff.txt>______________________________________________ > R-devel at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel
Reasonably Related Threads
- What is the threshold for `useRaster` of graphics::image()?
- colored rasterImage()
- strange interaction between rasterImage and Grid graphics
- Using rasterImage on a CairoWin device prevents adding further elements to device?
- rasterImage and coordinate conversion