I have a working program written in Java (a 3d game) and some scripts in Python written with theano to process images. 
I am trying to capture the frames of the game as it is running and run these scripts on the frames.
My current implementation grabs the binary data from each pixel in the frame, saves the frame as a png image and calls the python script (using ProcessBuilder) which opens the image and does its thing.
Writing an image to file and then opening it in python is pretty inefficient, so I would like to be able to pass the binary data from Java to Python directly.
If I am not mistaken, processBuilder only takes arguments as strings, so does anyone know how I can pass this binary data directly to my python script? Any ideas?
Thanks
If there is no limit to the length of the string argument for launching the python script, you could simply encode the binary data from the image into a string, and pass that. The only problem you might encounter with this approach would be null characters and and negative numbers.
Passing binary data from java to python