{"record":{"id":"83b0b49e0eb4e50a","repo":"stride3d/stride","slug":"teximage-format-format-is-not-supported","errorCode":null,"errorMessage":"{ texImage.Format } format is not supported.","messagePattern":"(.+?) format is not supported\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"sources/engine/Stride.Assets/Physics/HeightmapAssetCompiler.cs","lineNumber":127,"sourceCode":"                        case PixelFormat.B8G8R8X8_UNorm:\n                        case PixelFormat.R8G8B8A8_UNorm:\n                        case PixelFormat.R8G8_UNorm:\n                            textureTool.Convert(texImage, PixelFormat.R8_UNorm);\n                            break;\n\n                        case PixelFormat.R8G8B8A8_SNorm:\n                        case PixelFormat.R8G8_SNorm:\n                            textureTool.Convert(texImage, PixelFormat.R8_UNorm);\n                            break;\n\n                        case PixelFormat.B8G8R8A8_UNorm_SRgb:\n                        case PixelFormat.B8G8R8X8_UNorm_SRgb:\n                        case PixelFormat.R8G8B8A8_UNorm_SRgb:\n                            textureTool.Convert(texImage, PixelFormat.R8_UNorm);\n                            break;\n\n                        default:\n                            throw new Exception($\"{ texImage.Format } format is not supported.\");\n                    }\n\n                    // Convert pixels to heights\n\n                    using (var image = textureTool.ConvertToStrideImage(texImage))\n                    {\n                        var pixelBuffer = image.PixelBuffer[0];\n                        var pixelBufferSize = new Int2(pixelBuffer.Width, pixelBuffer.Height);\n\n                        var minFloat = Parameters.FloatingPointComponentRange.X;\n                        var maxFloat = Parameters.FloatingPointComponentRange.Y;\n                        var isSNorm = (Math.Abs(-1 - minFloat) < float.Epsilon) && (Math.Abs(1 - maxFloat) < float.Epsilon);\n\n                        if (maxFloat < minFloat)\n                        {\n                            throw new Exception($\"{ nameof(Parameters.FloatingPointComponentRange) }.{ nameof(Parameters.FloatingPointComponentRange.Y) } should be greater than { nameof(Parameters.FloatingPointComponentRange.X) }.\");\n                        }\n","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/engine/Stride.Assets/Physics/HeightmapAssetCompiler.cs#L109-L145","documentation":"HeightmapAssetCompiler converts the source texture to R8_UNorm before building the heightmap, and only a fixed set of source pixel formats is supported. If texImage.Format falls outside the accepted B8G8R8X8/R8G8B8A8 (UNorm and SRgb) variants, it throws with the offending format name.","triggerScenarios":"Importing a heightmap image whose PixelFormat is not one of B8G8R8X8_UNorm, B8G8R8X8_UNorm_SRgb, R8G8B8A8_UNorm, or R8G8B8A8_UNorm_SRgb (e.g. 16-bit grayscale, R32_Float, or paletted PNG) in DoCommandOverride.","commonSituations":"Exporting heightmaps from terrain tools as 16-bit or single-channel grayscale images, or saving JPEG/PNG with unusual color depths.","solutions":["Re-save the heightmap image as 8-bit or 32-bit RGBA (R8G8B8A8 or BGRA8888)","Convert the image in an editor (GIMP/Photoshop) to an 8-bit-per-channel RGBA format","Pre-process the image with a script (e.g. ImageMagick: magick in.png -depth 8 -alpha off out.png)","Check the source texture asset's format in the editor's texture properties"],"exampleFix":"// before\nmagick height16.png heightmap.png // 16-bit, unsupported\n// after\nmagick height16.png -depth 8 -alpha off heightmap.png // R8G8B8A8-compatible","handlingStrategy":"validation","validationCode":"var fmt = GetImageFormat(path); // e.g. via Magick.NET or System.Drawing\nvar supported = new[] { PixelFormat.B8G8R8X8_UNorm, PixelFormat.B8G8R8X8_UNorm_SRgb, PixelFormat.R8G8B8A8_UNorm, PixelFormat.R8G8B8A8_UNorm_SRgb };\nif (!supported.Contains(fmt)) throw new InvalidOperationException($\"{fmt} not supported; re-save as 8-bit RGBA\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Export heightmaps as 8-bit-per-channel RGBA images","Avoid 16-bit or single-channel grayscale exports from terrain tools","Check image bit depth before adding to the project","Standardize a pre-import conversion step in your asset pipeline"],"tags":["physics","heightmap","pixel-format"],"backgroundTag":"unsupported-dtype","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}