A Texture based on an Image.
    public class ImageTexture : Texture

A Texture based on an Image. Can be created from an Image with CreateFromImage(Godot.Image, int).

Inheritance Chain


    public ImageTexture()


    public float LossyQuality { get; set; }

The storage quality for STORAGE_COMPRESS_LOSSY.

    public StorageEnum Storage { get; set; }

The storage type (raw, lossy, or compressed).


    public void Create(int width, int height, Image.Format format, int flags = 7)

Create a new ImageTexture with width and height.

format is a value from Image.Format, flags is any combination of Texture.Flags.

    public void CreateFromImage(Image image, int flags = 7)

Create a new ImageTexture from an Image with flags from Texture.Flags. An sRGB to linear color space conversion can take place, according to Image.Format.

    public Image.Format GetFormat()

Return the format of the ImageTexture, one of Image.Format.

    public float GetLossyStorageQuality()

Getter for LossyQuality

    public StorageEnum GetStorage()

Getter for Storage

    public Error Load(string path)

Load an ImageTexture from a file path.

    public void SetData(Image image)

Set the Image of this ImageTexture.

    public void SetLossyStorageQuality(float quality)

Setter for LossyQuality

    public void SetSizeOverride(Vector2 size)

Resizes the ImageTexture to the specified dimensions.

    public void SetStorage(StorageEnum mode)

Setter for Storage

Inner Types


Name Value Description
Raw 0 [Image] data is stored raw and unaltered.
CompressLossy 1 [Image] data is compressed with a lossy algorithm. You can set the storage quality with [member lossy_quality].
CompressLossless 2 [Image] data is compressed with a lossless algorithm.