title: How RBG triplet value is converted into single value? single value comes between 0 to 255. how single value is mapped into color image?
body: <p>Using OpenCV, input image(Blue background image Christmas tree inside) was read.</p>
  
  <p>Below image is input image.</p>
  
  <p><a href="https://i.stack.imgur.com/qudLg.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qudLg.jpg" alt="enter image description here"></a></p>
  
  <p>the output of read image is changed from a blue background into the red.</p>
  
  <p><a href="https://i.stack.imgur.com/aJBIr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aJBIr.png" alt="enter image description here"></a></p>
  
  <p>when I viewed the value of the variable of 'image' in spyder. Here 3 is RGB channel</p>
  
  <p><a href="https://i.stack.imgur.com/eqZo7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eqZo7.png" alt="enter image description here"></a>
  When double-clicked the value it shows with Axis =0. what I understood is BGR value</p>
  
  <p><a href="https://i.stack.imgur.com/dz59F.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dz59F.png" alt="enter image description here"></a></p>
  
  <p>Axis =1 here to0 BGR</p>
  
  <p><a href="https://i.stack.imgur.com/vswcZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vswcZ.png" alt="enter image description here"></a></p>
  
  <p>Axis =2. I am stuck here. I would not understand how triplet value of(pixel) RBG value is converted into a single value of each pixel and how this pixel(0,0)=254 represents red color here.</p>
  
  <p><a href="https://i.stack.imgur.com/YBeAm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YBeAm.png" alt="enter image description here"></a></p>
  
  <p>I understood for black and white values varies from 0 to 255. But here how axis =2 (pixel(0,0)=254) represents Red color(guessing from output of the read image). </p>