title: Grayscale CMYK pixel
body: <p>I need to convert a CMYK image to grayscaled CMYK image. At first i thought i can just use the same method as for RGB -> grayscale conversion, like (R + G + B) / 3 or max(r, g, b) / 2 + min(r, g, b). But unfortunately this works bad for CMYK, because CMY and K are redundant. And black cmyk (0, 0, 0, 255) will become 64. Should i just use</p>
  
  <pre><code>int grayscaled = max((c + m + y) / 3, k)
  </code></pre>
  
  <p>or could it be more tricky? I am not sure, because CMYK is actually a redundant color model, and the same color could be encoded in a different ways.</p>