This error is kind of strange but you are getting this exception because ImageMagick was unable to reduce the number of colors to 256. But I cannot reproduce the issue with your image. Are you using the latest version?

It really depends on the size of your image but it can take up a big amount of memory really fast. If only 3 GB is available for ImageMagick you might want to limit the memory usage to 2GB and use 'disk memory' for the rest. But that will really hurt the
performance of your application. You can do that with: ResourceLimits.Memory.