In my current project, my game has a websocket server that provides data to a python client. This data is used by different machine learning agents that then send different acctions back to the game to play.
I am now working on a feature for the server to provide screenshots of the game to the client (to use as input for neural networks). I know how to get a screenshot but I would like the server to send the image data to the client over websocket.
For this I have tried to send the data in different ways but I am not able to reconstruct the image in python.
In my function I have the following to get the Image object:
var image = get_viewport().get_texture().get_data()
image.flip_y()
I've tried sending the data in raw, base64 and hex but no progress. Any suggestion/idea? I think one of the problems is that I am not understanding the PoolByteArray object.