Attention: Here be dragons (unstable version)

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Redot.

ResourceImporterSpriteFrames

Inherits: ResourceImporter < RefCounted < Object

There is currently no description for this class. Please help us by contributing one!

Properties

float

animation/frame_speed_multiplier

1

bool

animation/loops

true

int

animation/max_frames

0

int

compress/channel_pack

0

float

compress/lossy_quality

0.7

int

compress/mode

0

int

compress/normal_map

0

float

compress/rdo_quality_loss

0.0

int

compress/uastc_level

0

bool

mipmaps/generate

false

int

mipmaps/limit

-1

int

process/channel_remap/alpha

3

int

process/channel_remap/blue

2

int

process/channel_remap/green

1

int

process/channel_remap/red

0

bool

process/fix_alpha_border

true

bool

process/hdr_as_srgb

false

bool

process/hdr_clamp_exposure

false

bool

process/premult_alpha

false

int

process/size_limit

0


Property Descriptions

float animation/frame_speed_multiplier = 1 🔗

The multiplier for each frame's delay.


bool animation/loops = true 🔗

If true, loops the sprite frame infinitely.


int animation/max_frames = 0 🔗

Controls the max amount of frames that will be imported.


int compress/channel_pack = 0 🔗

Controls how color channels should be used in the imported texture.

sRGB Friendly: Prevents the RG color format from being used, as it does not support sRGB color.

Optimized: Allows the RG color format to be used if the texture does not use the blue channel. This reduces memory usage if the texture's blue channel can be discarded (all pixels must have a blue value of 0).


float compress/lossy_quality = 0.7 🔗

The quality to use when using the Lossy compression mode. Higher values result in better quality, at the cost of larger file sizes. Lossy quality does not affect memory usage of the imported texture, only its file size on disk.


int compress/mode = 0 🔗

The compression mode to use. Each compression mode provides a different tradeoff:

Lossless: Original quality, high memory usage, high size on disk, fast import.

Lossy: Reduced quality, high memory usage, low size on disk, fast import.

Basis Universal: Reduced quality, low memory usage, lowest size on disk, slow import. Only use for textures in 3D scenes, not for 2D elements.

See Compress mode in the manual for more details.


int compress/normal_map = 0 🔗

When using the textures' as normal map, only the red and green channels are required. Given regular texture compression algorithms produce artifacts that don't look that nice in normal maps, the RGTC compression format is the best fit for this data. Forcing this option to Enable will make Redot import the image as RGTC compressed. By default, it's set to Detect. This means that if the texture is ever detected to be used as a normal map, it will be changed to Enable and reimported automatically.

Note that RGTC compression affects the resulting normal map image. You will have to adjust custom shaders that use the normal map's blue channel to take this into account. Built-in material shaders already ignore the blue channel in a normal map (regardless of the actual normal map's contents).


float compress/rdo_quality_loss = 0.0 🔗

If greater than or equal to 0.01, enables Rate-Distortion Optimization (RDO) to reduce file size. Higher values result in smaller file sizes but lower quality.

Note: Enabling RDO makes encoding times significantly longer, especially when the image is large.

See also ProjectSettings.rendering/textures/basis_universal/rdo_dict_size and ProjectSettings.rendering/textures/basis_universal/zstd_supercompression_level if you want to reduce the file size further.


int compress/uastc_level = 0 🔗

The UASTC encoding level. Higher values result in better quality but make encoding times longer.


bool mipmaps/generate = false 🔗

If true, smaller versions of the textures are generated on import. For example, a 64×64 texture will generate 6 mipmaps (32×32, 16×16, 8×8, 4×4, 2×2, 1×1). This has several benefits:

  • Textures will not become grainy in the distance (in 3D), or if scaled down due to Camera2D zoom or CanvasItem scale (in 2D).

  • Performance will improve if the texture is displayed in the distance, since sampling smaller versions of the original texture is faster and requires less memory bandwidth.

The downside of mipmaps is that they increase memory usage by roughly 33%.

It's recommended to enable mipmaps in 3D. However, in 2D, this should only be enabled if your project visibly benefits from having mipmaps enabled. If the camera never zooms out significantly, there won't be a benefit to enabling mipmaps but memory usage will increase.


int mipmaps/limit = -1 🔗

Unimplemented. This currently has no effect when changed.


int process/channel_remap/alpha = 3 🔗

Specifies the data source of the output for all the image alpha channels.

Red: Use the values from the source image's red channel.

Green: Use the values from the source image's green channel.

Blue: Use the values from the source image's blue channel.

Alpha: Use the values from the source image's alpha channel.

Red Inverted: Use inverted values from the source image's red channel (1.0 - R).

Green Inverted: Use inverted values from the source image's green channel (1.0 - G).

Blue Inverted: Use inverted values from the source image's blue channel (1.0 - B).

Alpha Inverted: Use inverted values from the source image's alpha channel (1.0 - A).

Unused: Set the color channel's value to the default (1.0 for alpha, 0.0 for red, green or blue).

Zero: Set the color channel's value to 0.0.

One: Set the color channel's value to 1.0.


int process/channel_remap/blue = 2 🔗

Specifies the data source of the output for all the image blue channels.

Red: Use the values from the source image's red channel.

Green: Use the values from the source image's green channel.

Blue: Use the values from the source image's blue channel.

Alpha: Use the values from the source image's alpha channel.

Red Inverted: Use inverted values from the source image's red channel (1.0 - R).

Green Inverted: Use inverted values from the source image's green channel (1.0 - G).

Blue Inverted: Use inverted values from the source image's blue channel (1.0 - B).

Alpha Inverted: Use inverted values from the source image's alpha channel (1.0 - A).

Unused: Set the color channel's value to the default (1.0 for alpha, 0.0 for red, green or blue).

Zero: Set the color channel's value to 0.0.

One: Set the color channel's value to 1.0.


int process/channel_remap/green = 1 🔗

Specifies the data source of the output for all the image green channels.

Red: Use the values from the source image's red channel.

Green: Use the values from the source image's green channel.

Blue: Use the values from the source image's blue channel.

Alpha: Use the values from the source image's alpha channel.

Red Inverted: Use inverted values from the source image's red channel (1.0 - R).

Green Inverted: Use inverted values from the source image's green channel (1.0 - G).

Blue Inverted: Use inverted values from the source image's blue channel (1.0 - B).

Alpha Inverted: Use inverted values from the source image's alpha channel (1.0 - A).

Unused: Set the color channel's value to the default (1.0 for alpha, 0.0 for red, green or blue).

Zero: Set the color channel's value to 0.0.

One: Set the color channel's value to 1.0.


int process/channel_remap/red = 0 🔗

Specifies the data source of the output for all the image red channels.

Red: Use the values from the source image's red channel.

Green: Use the values from the source image's green channel.

Blue: Use the values from the source image's blue channel.

Alpha: Use the values from the source image's alpha channel.

Red Inverted: Use inverted values from the source image's red channel (1.0 - R).

Green Inverted: Use inverted values from the source image's green channel (1.0 - G).

Blue Inverted: Use inverted values from the source image's blue channel (1.0 - B).

Alpha Inverted: Use inverted values from the source image's alpha channel (1.0 - A).

Unused: Set the color channel's value to the default (1.0 for alpha, 0.0 for red, green or blue).

Zero: Set the color channel's value to 0.0.

One: Set the color channel's value to 1.0.


bool process/fix_alpha_border = true 🔗

If true, puts pixels of the same surrounding color in transition from transparent to opaque areas. For textures displayed with bilinear filtering, this helps to reduce the outline effect when exporting images from an image editor.

It's recommended to leave this enabled (as it is by default), unless this causes issues for a particular image.


bool process/hdr_as_srgb = false 🔗

Some HDR images you can find online may be broken and contain sRGB color data (instead of linear color data). It is advised not to use those files. If you absolutely have to, enabling process/hdr_as_srgb will make them look correct.

Warning: Enabling process/hdr_as_srgb on well-formatted HDR images will cause the resulting image to look too dark, so leave this on false if unsure.


bool process/hdr_clamp_exposure = false 🔗

If true, clamps exposure in the imported high dynamic range images using a smart clamping formula (without introducing visible clipping).

Some HDR panorama images you can find online may contain extremely bright pixels, due to being taken from real life sources without any clipping.

While these HDR panorama images are accurate to real life, this can cause the radiance map generated by Redot to contain sparkles when used as a background sky. This can be seen in material reflections (even on rough materials in extreme cases). Enabling process/hdr_clamp_exposure can resolve this.


bool process/premult_alpha = false 🔗

An alternative to fixing darkened borders with process/fix_alpha_border is to use premultiplied alpha. By enabling this option, each texture will be converted to this format. A premultiplied alpha texture requires specific materials to be displayed correctly:


int process/size_limit = 0 🔗

If set to a value greater than 0, the size of any texture is limited on import to a value smaller than or equal to the value specified here. For non-square textures, the size limit affects the longer dimension, with the shorter dimension scaled to preserve aspect ratio. Resizing is performed using cubic interpolation.

This can be used to reduce memory usage without affecting the source images, or avoid issues with textures not displaying on mobile/web platforms (as these usually can't display textures larger than 4096×4096).

Note: Even if this is set to 0, import size is limited to the following dimensions for technical reasons. Depending on compress/mode, textures will be downsampled on import if necessary:

  • Lossy: 16383 pixels width or height, whichever is larger;

  • Basis Universal: 16384 pixels width or height, whichever is larger;

  • All other modes: 32768 pixels width or height, whichever is larger.