search for: readpng

Displaying 10 results from an estimated 10 matches for "readpng".

Did you mean: reading
2011 Feb 14
1
readPNG gives warnings and doesn't execute sample code from help files
Dear all, I noticed in the latest R version (R.2.12.1) that the readPNG gives following warning when running the example code in the help file (or when using any other png for that matter) : 50: In rasterImage(img, 1.2, 1.27, 1.8, 1.73) : Per-pixel alpha not supported on this device No picture is shown, and code I used to be able to run, doesn't run any more....
2011 Sep 23
1
spatstat => owin + image
...)) x2=ceiling(max(data[,2],na.rm=T )*(1+b)) y1=floor(min(data[,3],na.rm=T )*(1-c)) y2=ceiling(max(data[,3],na.rm=T )*(1+c)) x1 x2 y1 y2 w = owin(c(x1,x2),c(y1,y2)) w dat1 = as.ppp(data[,2:4],w) is.ppp(dat1) str(dat1) #Get the plot information so the image will fill the plot box, and draw it ima = readPNG("file.png") lim = par() rasterImage(ima, lim$usr[1], lim$usr[3], lim$usr[2], lim$usr[4]) par(new=T) plot(dat1, use.marks=T) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Thank you for any advice. Kind Regards TKD -- View this message in context: http://r.789695.n4.nabble.com/spatstat-owin-image-t...
2013 Jun 21
1
Abrir Png
...e un mapa guardado en formato png. Mi intención es abrirlo dentro de R para intentar manipularlo luego. El caso es que soy incapaz de abrilo. He probado con read.png, pero me sale un churro en el dispositivo gráfico, no se ve absolutamente nada.. Esto es lo que he intentado library(png) icesmap<-readPNG("Mapa_Ices.png") plot (icesmap)     A lo mejor debería probar  en otro formato??   Un saludo Pepeceb [[alternative HTML version deleted]]
2011 Feb 15
1
Using rasterImage on a CairoWin device prevents adding further elements to device?
I was pointed to the Cairo package for plotting PNG images on a device. I've been playing around with it, but found that after I use the rasterImage function, I can't add anything any more to the device, eg : img <- readPNG(system.file("img", "Rlogo.png", package="png")) r = as.raster(img[,,1:3]) r[img[,,4] == 0] = "white" CairoWin() plot(1:2,1:2,type="l") rasterImage(r,1,1,2,2) points(seq(1,2,by=0.1),seq(2,1,by=-0.1),col="black") The points are not plotted...
2011 Nov 16
2
strange behavior from cex="*"
...te("tmp",seq(n),"png",sep=".") for (i in seq(n)) { png(fn[i]) plot(1:10,1:10,cex="*"); dev.off() } ff <- subset(file.info(fn),select=size) ff <- ff[!duplicated(ff$size),,drop=FALSE] table(ff$size) require(png) pngs <- lapply(rownames(ff),readPNG) png.to.img <- function(x) matrix(rgb(x[,,1],x[,,2],x[,,3]), nrow=dim(x)[1],ncol=dim(x)[2]) imgs <- lapply(pngs,png.to.img) par(mfrow=c(2,2)) lapply(imgs,function(x) { plot(0:1,0:1,type="n",ann=FALSE,axes=FALSE) rasterImage(x,0,0,1,1) }) ####...
2011 Nov 18
1
How to fill irregular polygons with patterns?
Hi, I'm looking the best way to fill irregular polygons with patterns, Something like the function grid.pattern do, but my case is with irregular polygons. Whit this script I can get it, but I'm looking for an "elegant" solution.. library(grid) grid.polygon(x=c(0.2, 0.8, 0.6, 0.6, 0.8, 0.2), y=c(0.2, 0.2, 0.3, 0.5, 0.7,0.7), gp=gpar(fill="grey",
2011 Jun 07
1
Packages for R-CRAN (organizing aspects)
Hello, I have some ideas for packages that I want to provide on R-CRAN. One package alreads is working, but I have some warnings in when compiling. Also I don't know if the libraries in use are only working on Unix/Linux. So I have some general questions: - If I'm not sure if the code would also work on windows (needing some ceratain libraries or tools), would it be better to
2013 Oct 10
1
install.packages() removes package on Windows
Hi, Starting with the XML package installed: > "XML" %in% rownames(installed.packages()) [1] TRUE > I ran the following script: pkgs <- c("XML") for (i in 1:100) { install.packages(pkgs, repos="http://cran.fhcrc.org") if (!all(pkgs %in% rownames(installed.packages()))) { print("failed to install pkgs!")
2010 Apr 17
2
grid.cap() requires more time?
Dear all, I am puzzled by the following behavior of the new grid.cap() function, which appears to run out of time when capturing the output of a graphic. It works fine if I introduce a Sys.sleep(1) before executing more code, library(grid) quartz() grid.circle(gp=gpar(fill="black")) gg <- grid.cap() dev.new() grid.raster(gg) ## completely blank gg[gg!="white"] ## indeed
2020 Jun 12
3
tcltk image reading problem (on a mac?): [tcl] encountered an unsupported criticial chunk type "eXIf"
I don't know what has changed with Catalina But I just tried my tk console from the shell command tkcon And got the following error. Here is my shell: $ tkcon dyld: Library not loaded: /usr/local/lib:/opt/X11/lib/libtk8.6.dylib Referenced from: /usr/local/bin/wish Reason: image not found Abort trap: 6 I don't know whether this is a red herring or not, but the