What package to upload and save images to R

I know this was asked before, but existing answers seem deprecated since I cannot install Bio7 or rimage using install.packages and search for cran repository for Bio7 gives link 404 (am I missing something?).

So what are the right packages to load / save images in R to handle pixels from R?

I do not need this to provide processing procedures. While it can reliably turn jpeg into a grid of pixel values ​​and vice versa (and it is advisable to do the same for png), I can write the processing code.

+4
source share
1 answer

I think raster is what you need.

 library(png) img <- readPNG(system.file("img", "Rlogo.png", package="png")) ## convert it to a raster, interpolate =F to select only sample of pixels of img img.r <- as.raster(img,interpolate=F) 

Now you have a color vector:

  str(img.r) 'raster' chr [1:76, 1:100] "#00000000" "#0 
+5
source

All Articles