Enum ImageFileFormat
Specifies the image file formats supported by ScyllaFileUtil for
loading and saving Texture2D assets.
Not all formats are available in every Unity version or on every platform. Use IsImageFormatSupported(ImageFileFormat) to query runtime availability before attempting to encode an image, particularly for WEBP, which requires Unity 2021.2 or later.
Format selection affects file size, image fidelity, transparency support, and dynamic range. See individual enum value summaries for guidance on choosing the appropriate format for a given use case.
Namespace: Scylla.Core.Util.File
Assembly: ScyllaCore.dll
Syntax
public enum ImageFileFormat
Fields
| Name | Description |
|---|---|
| EXR | EXR (OpenEXR) - high dynamic range format supporting 16-bit half-float and 32-bit float color channels. EXR is the industry-standard format for HDR imagery, VFX pipelines, and linear color space workflows. It preserves a far greater luminance range than 8-bit formats, making it essential for HDR render captures and environment maps.
The Quality property has no effect on EXR.
Compression behavior is controlled via EXRFlags,
which maps to |
| JPG | JPEG/JPG (Joint Photographic Experts Group) - lossy compression without transparency support. JPEG achieves smaller file sizes than PNG at the cost of irreversible compression artifacts. It is well-suited for photographic content or any image where a smaller file size is more important than pixel-perfect accuracy. Transparency is not supported. Any alpha channel in the source texture is discarded during encoding. The Quality property controls the trade-off between image fidelity and file size; higher values produce larger files with fewer artifacts. |
| PNG | PNG (Portable Network Graphics) - lossless compression with full alpha channel support. PNG is the default format used by Default. It preserves every pixel exactly and supports a full 8-bit alpha channel, making it the preferred choice for UI textures, sprites, and any image where transparency or pixel-perfect fidelity is required. The Quality property has no effect on PNG; all PNG output is always lossless. |
| TGA | TGA (Truevision TGA / Targa) - legacy uncompressed or RLE-compressed format with alpha channel support. TGA is a legacy format still widely used in game asset pipelines and 3D modeling tools. It supports a full alpha channel and produces large files when uncompressed. For new assets, PNG is generally preferred unless interoperability with legacy tooling requires TGA.
TGA files have no standardized magic bytes; format detection from raw data
is not possible. Use a |
| WEBP | WebP - modern format supporting both lossy and lossless compression with full alpha channel support. WebP typically achieves smaller file sizes than both PNG (lossless mode) and JPEG (lossy mode) while maintaining comparable quality. It supports a full alpha channel in both modes, making it a versatile replacement for PNG and JPEG in web and mobile contexts. WEBP encoding requires Unity 2021.2 or later. Query runtime availability with IsImageFormatSupported(ImageFileFormat) before use. The Quality property controls the lossy compression level (1-100). |