> for(i in 1:dims[1]) x[i,]<-rev(x[i,]) #flip the image vertically Courtesy of Rolf Turner, here is a much better way to flip vertically: x <- x[,ncol(x):1] Bill