Loaded resource as image file, this will not work on export

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By droc101

I am trying to load an image to get pixels from it. The code I am using is Image.load("res://image.png") This works in the editor, but not on export, as the error says. The file in imported as a Texture, and the full error is: Loaded resource as image file, this will not work on export: 'res://image.png'. Instead, import the image file as an Image resource and load it normally as a resource.

:bust_in_silhouette: Reply From: Lopy

Try using load(“res://image.png”) directly. It should return you a Texture, which has a get_data() function.