{"record":{"id":"8aaa0656dfc137fc","repo":"MonoGame/MonoGame","slug":"unsupported-rgb-pixel-format","errorCode":null,"errorMessage":"Unsupported RGB pixel format","messagePattern":"Unsupported RGB pixel format","errorType":"exception","errorClass":"ContentLoadException","httpStatus":null,"severity":"error","filePath":"MonoGame.Framework.Content.Pipeline/DdsLoader.cs","lineNumber":167,"sourceCode":"                        rbSwap = pixelFormat.dwBBitMask == 0xFF;\n                        return SurfaceFormat.Color;\n                    }\n                    throw new ContentLoadException(\"Unsupported RGBA pixel format\");\n                }\n                else\n                {\n                    switch (pixelFormat.dwRgbBitCount)\n                    {\n                        // Format contains RGB only\n                        case 16:\n                            rbSwap = pixelFormat.dwBBitMask == 0x1F;\n                            return SurfaceFormat.Bgr565;\n                        case 24:\n                        case 32:\n                            rbSwap = pixelFormat.dwBBitMask == 0xFF;\n                            return SurfaceFormat.Color;\n                        default:\n                            throw new ContentLoadException(\"Unsupported RGB pixel format\");\n                    }\n                }\n            }\n            //else if (pixelFormat.dwFlags.HasFlag(Ddpf.Luminance))\n            //{\n            //    return SurfaceFormat.Alpha8;\n            //}\n            throw new ContentLoadException(\"Unsupported pixel format\");\n        }\n\n        private static BitmapContent CreateBitmapContent(SurfaceFormat format, int width, int height) => format switch\n            {\n                SurfaceFormat.Color => new PixelBitmapContent<Color>(width, height),\n                SurfaceFormat.Bgra4444 => new PixelBitmapContent<Bgra4444>(width, height),\n                SurfaceFormat.Bgra5551 => new PixelBitmapContent<Bgra5551>(width, height),\n                SurfaceFormat.Bgr565 => new PixelBitmapContent<Bgr565>(width, height),\n                SurfaceFormat.Dxt1 => new Dxt1BitmapContent(width, height),\n                SurfaceFormat.Dxt3 => new Dxt3BitmapContent(width, height),","sourceCodeStart":149,"sourceCodeEnd":185,"githubUrl":"https://github.com/MonoGame/MonoGame/blob/1d71bbd0ff4071a03caa583aa3bc56b85924a819/MonoGame.Framework.Content.Pipeline/DdsLoader.cs#L149-L185","documentation":"Thrown by DdsLoader.GetSurfaceFormat when a DDS file declares an RGB-only pixel format (DDPF.RGB without AlphaPixels) whose dwRgbBitCount is not 16, 24, or 32. The importer supports 16-bit Bgr565, 24-bit, and 32-bit Color uncompressed RGB formats only.","triggerScenarios":"Importing an uncompressed RGB DDS with a dwRgbBitCount value outside {16, 24, 32}, e.g. 8-bit paletted or other non-standard depth.","commonSituations":"Legacy paletted DDS exports; DDS files generated by unusual toolchains producing non-standard RGB depths; corrupted DDS headers.","solutions":["Re-export the texture at 32-bit B8G8R8X8 or to a supported block-compressed format.","Run texconv -f B8G8R8A8_UNORM input.dds to normalize to a supported uncompressed format.","Inspect the DDS header to confirm dwRgbBitCount and bit masks are consistent."],"exampleFix":"// before: RGB DDS with unsupported bit depth (e.g. 8-bit)\n// after:\n//   texconv -f B8G8R8A8_UNORM texture.dds","handlingStrategy":"validation","validationCode":"// Normalize RGB DDS files to a supported depth:\n//   texconv -f B8G8R8A8_UNORM asset.dds\n// Or for opaque textures, ensure dwRgbBitCount is 16, 24, or 32.","typeGuard":null,"tryCatchPattern":"try\n{\n    texture = DdsLoader.Import(filename, context);\n}\ncatch (ContentLoadException ex) when (ex.Message.Contains(\"Unsupported RGB pixel format\"))\n{\n    logger.LogMessage($\"{filename} has an unsupported RGB bit depth; re-export as 24/32-bit.\");\n    throw;\n}","preventionTips":["Use 24-bit or 32-bit RGB when exporting uncompressed DDS.","Avoid paletted (8-bit) or other non-standard RGB depths.","Run texconv as a normalization step in CI."],"tags":["dds","texture","content-pipeline","unsupported-format","monogame"],"backgroundTag":null,"analyzedSha":"1d71bbd0ff4071a03caa583aa3bc56b85924a819","analyzedAt":"2026-08-13T17:10:33.625Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}