Hi All,
I have a color png image which I read in R using the PNG package. Now to begin with I want to display this colored png image in grayscale. Then I want to convert this colored png image in grayscale format for further processing.
Following is the code for reading and displaying the colored image that I have used –
img <- readPNG("roi_new.png",FALSE);
plot(1:2, type='n');
img <- as.raster(img[,,1:3]);
rasterImage(img, 1.2, 1.27, 1.8, 1.73); Thanks & Regards,
Ajinkya Ghorpade