It seems I misunderstood your problem. Can you post your code in a code block (```C#) next time? If you want your image to be indexed you should set the ClassType to Pseudo:
using (MagickImage image = new MagickImage(@"E:\Development\DOTNET\PCXEditor\RGBEditor\18975253ee.pcx")) { MagickColor target = new MagickColor(128, 118, 118); MagickColor fill = new MagickColor(100, 105, 110); image.Opaque(target, fill); image.ClassType = ClassType.Pseudo; // Or use the 'Quantize' method if you want more control. image.Write(@"E:\Development\DOTNET\PCXEditor\RGBEditor\1897525311-changed.pcx"); }