title: ImageMagick C# Exception : no pixels defined in cache
body: <p>I'm trying to create a new image with a specific <code>ColorType</code> (it does the same thing with <code>ColorSpace</code>) and I have this error: <code>no pixels defined in cache</code>.</p>
  <p>I'm not trying to load/read an existing image. I'm not trying to save the image. I'm just trying to set a property of the object. I don't even understand why there would be an exception thrown here.</p>
  <p>Here is the code that is failing:</p>
  <pre class="lang-cs prettyprint-override"><code>MagickImage img = new();
  img.ColorType = ColorType.GrayscaleAlpha;
  </code></pre>
  <p>Here is the exception that is thrown:</p>
  <p><a href="https://i.stack.imgur.com/jBlpB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jBlpB.png" alt="enter image description here" /></a></p>
  <p>If I remove the line that is failing, everything works fine. But I want to create a Png image with only gray and alpha channel. Maybe I'm not doing that properly.</p>
  <p>Thanks for your help!</p>