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 ImageTexture.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” one of Image.FORMAT_*.

“flags” one or more of Texture.FLAG_*.

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

Create a new ImageTexture from an Image with “flags” from Texture.FLAG_*.

    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 void Load(string path)

Load an ImageTexture.

    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 [method set_lossy_storage_quality].
CompressLossless 2 [Image] data is compressed with a lossless algorithm.