{"record":{"id":"0dc91f82afc2992d","repo":"bevyengine/bevy","slug":"the-image-uses-a-texture-format-1-that-is-no","errorCode":null,"errorMessage":"the image uses a texture format \"{1:?}\" that is not supported for saving by the image format \"{0:?}\"","messagePattern":"the image uses a texture format \"(.+?)\" that is not supported for saving by the image format \"(.+?)\"","errorType":"exception","errorClass":"SaveImageError","httpStatus":null,"severity":"error","filePath":"crates/bevy_image/src/saver.rs","lineNumber":144,"sourceCode":"/// An error while saving an image.\n#[derive(Error, Debug)]\npub enum SaveImageError {\n    /// Cannot deduce file format from extension because there is no extension.\n    #[error(\"SaveImageFormatSetting::FromExtension was set, but the asset path \\\"{0}\\\" has no extension\")]\n    MissingExtension(AssetPath<'static>),\n    /// Cannot deduce file format from extension since this extension is unknown. Holds the\n    /// extension that could not be matched.\n    #[error(\"could not determine asset format for extension \\\"{0}\\\"\")]\n    UnknownExtension(String),\n    /// [`Image::data`] is [`None`], so there is no data to save. See\n    /// [`RenderAssetUsages`](bevy_asset::RenderAssetUsages) for more.\n    #[error(\"the provided image does not contain any pixel data. Its data may live on the GPU (which we can't save out) due to `RenderAssetUsages`\")]\n    ImageMissingData,\n    /// The image saver doesn't support the file format being requested.\n    #[error(\"the requested file format {0:?} is not supported for saving\")]\n    UnsupportedFormat(ImageFormat),\n    /// The image saver doesn't support the texture format of the image data for the image format.\n    #[error(\"the image uses a texture format \\\"{1:?}\\\" that is not supported for saving by the image format \\\"{0:?}\\\"\")]\n    UnsupportedSaveColorTypeForFormat(ImageFormat, TextureFormat),\n    /// The [`image`] crate returned an error.\n    #[error(transparent)]\n    ImageError(#[from] image::ImageError),\n    /// Writing the bytes returned an error.\n    #[error(transparent)]\n    IoError(#[from] std::io::Error),\n}\n\n#[cfg(test)]\nmod tests {\n    use std::path::Path;\n\n    use bevy_app::{App, TaskPoolPlugin};\n    use bevy_asset::{\n        io::{\n            memory::{Dir, MemoryAssetReader, MemoryAssetWriter},\n            AssetSourceBuilder, AssetSourceId,","sourceCodeStart":126,"sourceCodeEnd":162,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_image/src/saver.rs#L126-L162","documentation":"SaveImageError variant raised when the image's TextureFormat is not encodable by the chosen output file format, e.g. saving a compressed or float texture to PNG. The image texture format and target file format are held in the payload; convert to a compatible texture format first.","triggerScenarios":"Thrown at crates/bevy_image/src/saver.rs:144 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Convert the image's texture format to one supported by the target file format before saving","Choose a file format that supports the texture format (e.g. Png for Rgba8)"],"exampleFix":null,"handlingStrategy":"validation","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-14T00:17:10.932Z"}