Converting color png image to grayscale.

R programming language resources Forums Data manipulation Converting color png image to grayscale.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #479

    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

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.
Scroll to top
Privacy Policy