Alpha channel for Image resource

Godot Version

4.4

Question

How to add an alpha channel to a loaded Image?
Alos, I cannot load an input image with the alpha component:

@export var _input_image:Image
print(_input_image.detect_alpha())
print(_input_image.detect_used_channels())

The output is: 0 and 0 (ALPHA_NONE and USED_CHANNELS_L)
Even though it looks like it is recognized as RGBA:

Cheers,
Maks

Does the source image have alpha? If you’re getting USED_CHANNELS_L, that implies just a single luminance channel.

I’m suspecting if you’re loading the image, you’re calling the detect functions before the data is loaded and getting default values; all zeros is suspicious.

1 Like

I found that depending on the values filling the image the result of these functions might differ (instead of the format being an inner property).