Creating a new MagickImage using the colors of an image pre-alterations and then attempting to use that image as a map for the image after alterations such as an ordered dither like so:
MagickImage magickImage = new MagickImage(decompressedBytes);
magickImage.Settings.SetDefine(MagickFormat.Dds, "compression", "none");
MagickImage originalColors = new MagickImage(magickImage.UniqueColors());
magickImage.OrderedDither("o4x4,8");
magickImage.Map(originalColors);
Results in the following error:
Unhandled exception. ImageMagick.MagickResourceLimitErrorException: unable to create colormap `' @ error/colormap.c/AcquireImageColormap/123
at ImageMagick.MagickExceptionHelper.Check(IntPtr exception) in /_/src/Magick.NET/Exceptions/MagickExceptionHelper.cs:line 18
at ImageMagick.NativeHelper.CheckException(IntPtr exception) in /_/src/Magick.NET/Native/NativeHelper.cs:line 27
at ImageMagick.MagickImage.NativeMagickImage.Map(IMagickImage image, IQuantizeSettings settings) in /_/src/Magick.NET/Native/MagickImage.cs:line 6376
at ImageMagick.MagickImage.Map(IMagickImage image, IQuantizeSettings settings) in /_/src/Magick.NET/MagickImage.cs:line 4063
at ImageMagick.MagickImage.Map(IMagickImage image) in /_/src/Magick.NET/MagickImage.cs:line 4049
at (my program) ...
I have tried a few variations to rule out certain causes, such as doing no image manipulation, but even simply creating the image and using it as a map with no changes results in this same error. This only seems to be occuring with DDS images, because I tested both with a compressed one that was saved on my desktop and an uncompressed one saved as a byte array in memory. However, doing the same thing with a PNG image did not result in the error.
Strangely, if I used the image itself as it's own map (ex: magickImage.Map(magickImage)) there was no error, even with DDS.
Magick.NET version
Magick.NET-Q8-AnyCPU
Environment (Operating system, version and so on)
Windows 10, Visual Studio 2022
Description
Creating a new MagickImage using the colors of an image pre-alterations and then attempting to use that image as a map for the image after alterations such as an ordered dither like so:
Results in the following error:
I have tried a few variations to rule out certain causes, such as doing no image manipulation, but even simply creating the image and using it as a map with no changes results in this same error. This only seems to be occuring with DDS images, because I tested both with a compressed one that was saved on my desktop and an uncompressed one saved as a byte array in memory. However, doing the same thing with a PNG image did not result in the error.
Strangely, if I used the image itself as it's own map (ex:
magickImage.Map(magickImage)
) there was no error, even with DDS.Steps to Reproduce