Hi, I am trying to build a scene with custom textures, which I pre-process using PIL. From PIL I then convert them to ui.Image and then I want to load them as a Texture. Unfortunately, I cannot get them to load at all. Included is a minimum (non-) working example with a normal png in my project directory.
import ui, scene
image = ui.Image('sprite.png')
image.show() # this works
texture = scene.Texture(image) # this fails
'''
Traceback (most recent call last):
File "/private/var/mobile/Containers/Shared/AppGroup/73760516-2464-4322-8DCC-0525D46DFFC3/Pythonista3/Documents/smw/minimal_example.py", line 5, in <module>
texture = scene.Texture(image)
ValueError: Could not load image
'''
texture = scene.Texture('sprite.png') # this fails as well
'''
Traceback (most recent call last):
File "/private/var/mobile/Containers/Shared/AppGroup/73760516-2464-4322-8DCC-0525D46DFFC3/Pythonista3/Documents/smw/minimal_example.py", line 6, in <module>
texture = scene.Texture('sprite.png')
ValueError: Image not found
'''
The sprite.png is a 32x32 PNG with a size of 981 bytes. I had no luck getting this to work with other images so far.
Any help is appreciated.