bevyengine/bevy · error · CompressedImageSaverError

Unsupported texture format for compression: {0:?}

Error message

Unsupported texture format for compression: {0:?}

What it means

CompressedImageSaverError::UnsupportedTextureFormat: the image's TextureFormat is not one the compression backend can encode, so the save is refused with the offending format listed.

Source

Thrown at crates/bevy_image/src/compressed_image_saver/mod.rs:215

    /// The image has no alpha channel.
    Opaque,
}

/// Errors encountered when writing compressed images via [`CompressedImageSaver`].
#[non_exhaustive]
#[derive(Debug, Error, TypePath)]
pub enum CompressedImageSaverError {
    /// I/O error.
    #[error(transparent)]
    Io(#[from] std::io::Error),
    /// The underlying compression library returned an error.
    #[error(transparent)]
    CompressionFailed(Box<dyn core::error::Error + Send + Sync>),
    /// Attempted to save an image with uninitialized data.
    #[error("Cannot compress an uninitialized image")]
    UninitializedImage,
    /// The texture format is not supported for compression.
    #[error("Unsupported texture format for compression: {0:?}")]
    UnsupportedFormat(TextureFormat),
    /// `is_normal_map` was set, but the input [`Image`]'s `texture_descriptor.format` is an sRGB
    /// variant (e.g. `Rgba8UnormSrgb`). Normal maps must be stored as linear vector data. Typically this means
    /// configuring the [`ImageLoaderSettings`] with `is_srgb: false` for this image.
    #[error(
        "Cannot compress an sRGB texture ({0:?}) as a normal map; \
         the input Image's texture_descriptor.format must be a non-sRGB (linear) variant"
    )]
    NormalMapMustBeLinear(TextureFormat),
}

View on GitHub (pinned to 396ca72708)

Solutions

  1. Convert the image to a compressible format (e.g. Rgba8UnormSrgb) before saving
  2. Use a different ImageSaver that accepts the format
  3. Skip compression for unsupported formats and save uncompressed
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at crates/bevy_image/src/compressed_image_saver/mod.rs:215 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of bevyengine/bevy@396ca72708 (2026-08-20). Data as JSON: /api/errors/a67da4444c47271d. Report an issue: GitHub.