title: numpy transforming RGB image to YIQ color space
body: <p>For a class, I need to transform RGB image into YIQ.
  We have been told that the conversion can be made by:</p>
  
  <p><a href="https://i.stack.imgur.com/R22jh.png" rel="noreferrer"><img src="https://i.stack.imgur.com/R22jh.png" alt="transforming rgb to yiq"></a></p>
  
  <p>I started to write a messy code with loops to have the matrix multiplication and then I found out a function</p>
  
  <pre><code> skimage.color.yiq2rgb(imYIQ)
  </code></pre>
  
  <p>and when I looked inside to see what they were doing I saw the following (I'm copying stuff so it will be more clear):</p>
  
  <pre><code>yiq_from_rgb = yiq_from_rgb = np.array([[0.299,      0.587,        0.114],
                                   [0.59590059, -0.27455667, -0.32134392],
                                   [0.21153661, -0.52273617, 0.31119955]])
  return np.dot(arr, yiq_from_rgb.T.copy())
  </code></pre>
  
  <p>when <code>arr</code> is just the RGB pic as a matrix</p>
  
  <p>I'm trying to understand why this works? why do they take the Transpose matrix? (.T)
  And how exactly does the dot product work when the <code>arr</code> shape is different than the yiq_from_rgb?</p>