{"record":{"id":"e4a05305475ce22e","repo":"bevyengine/bevy","slug":"the-provided-image-does-not-contain-any-pixel-data","errorCode":null,"errorMessage":"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`","messagePattern":"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`","errorType":"exception","errorClass":"SaveImageError","httpStatus":null,"severity":"error","filePath":"crates/bevy_image/src/saver.rs","lineNumber":138,"sourceCode":"    #[default]\n    FromExtension,\n    /// This is the explicit file format being written.\n    Format(ImageFormat),\n}\n\n/// 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;","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_image/src/saver.rs#L120-L156","documentation":"SaveImageError variant raised when Image::data is None because the image's pixel data was kept GPU-only via RenderAssetUsages (e.g. RENDER_USAGE main-world images). The CPU has no bytes to serialize; re-create the image with MAIN_WORLD | SAVE_USAGE or copy data back before saving.","triggerScenarios":"Thrown at crates/bevy_image/src/saver.rs:138 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Create the image with RenderAssetUsages::MAIN_WORLD (or not RENDER_WORLD only) so CPU data is retained","Read the texture back from the GPU before saving","Maintain a separate CPU-side copy of the image for saving"],"exampleFix":null,"handlingStrategy":"type-guard","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"}