title: How to extract the RGB values from the image and calculate its output?
body: <p>I have a function where I have got the RGB-values from the image and calculate the mean value for each pixel,  how can I approach this problem?</p>
  <pre><code>function RGB2G_mean(img::Matrix{RGB{T}}) where T&lt;:Fractional
      # get RGB-values from img
       # R,G,B=...
  
       output =
      return Gray.(output)
  end
  </code></pre>