R/Color_Exchange 2.R

Defines functions color_exchange

color_exchange = function(image1){
image = image1
for (i in 1: nrow(image)){
  for (j in 1:ncol(image)){
    if(image[i,j] == 1){
      image[i,j] = 0
    }
    else
      image[i,j] = 1
  }
}
return (image)
}

#image1 = readPNG("~/Desktop/Visible/initial1.png")
#image = color_exchange(image1)
#writePNG(image,"~/Desktop/Visible/initial2.png")
rwang14/implant documentation built on Dec. 9, 2019, 6:36 p.m.