{"record":{"id":"c0f30277d12fbefa","repo":"bevyengine/bevy","slug":"cannot-compress-an-srgb-texture-0-as-a-norma","errorCode":null,"errorMessage":"Cannot compress an sRGB texture ({0:?}) as a normal map; the input Image's texture_descriptor.format must be a non-sRGB (linear) variant","messagePattern":"Cannot compress an sRGB texture \\((.+?)\\) as a normal map; the input Image's texture_descriptor\\.format must be a non-sRGB \\(linear\\) variant","errorType":"exception","errorClass":"CompressedImageSaverError","httpStatus":null,"severity":"error","filePath":"crates/bevy_image/src/compressed_image_saver/mod.rs","lineNumber":220,"sourceCode":"#[non_exhaustive]\n#[derive(Debug, Error, TypePath)]\npub enum CompressedImageSaverError {\n    /// I/O error.\n    #[error(transparent)]\n    Io(#[from] std::io::Error),\n    /// The underlying compression library returned an error.\n    #[error(transparent)]\n    CompressionFailed(Box<dyn core::error::Error + Send + Sync>),\n    /// Attempted to save an image with uninitialized data.\n    #[error(\"Cannot compress an uninitialized image\")]\n    UninitializedImage,\n    /// The texture format is not supported for compression.\n    #[error(\"Unsupported texture format for compression: {0:?}\")]\n    UnsupportedFormat(TextureFormat),\n    /// `is_normal_map` was set, but the input [`Image`]'s `texture_descriptor.format` is an sRGB\n    /// variant (e.g. `Rgba8UnormSrgb`). Normal maps must be stored as linear vector data. Typically this means\n    /// configuring the [`ImageLoaderSettings`] with `is_srgb: false` for this image.\n    #[error(\n        \"Cannot compress an sRGB texture ({0:?}) as a normal map; \\\n         the input Image's texture_descriptor.format must be a non-sRGB (linear) variant\"\n    )]\n    NormalMapMustBeLinear(TextureFormat),\n}\n","sourceCodeStart":202,"sourceCodeEnd":226,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_image/src/compressed_image_saver/mod.rs#L202-L226","documentation":"CompressedImageSaverError normal-map variant: saving as a normal map requires linear data, but the image's texture format is an sRGB variant, which would corrupt normals if compressed as-is.","triggerScenarios":"Thrown at crates/bevy_image/src/compressed_image_saver/mod.rs:220 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Change the image's texture_descriptor.format to the linear (non-sRGB) counterpart before saving","Load/generate normal maps with linear formats","Don't mark the asset as a normal map if it is genuinely sRGB color data"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"396ca727080776bd313bb892423b7d94e03b81b4","analyzedAt":"2026-08-20T16:12:39.808Z","contentChangedAt":"2026-08-20T16:12:39.808Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}