I have a python script where some plots are created, which I need to pass to Knime. As I do not know in advance how many plots are created, I would like to store them in a table instead of using a static image port.
For testing purposes I tried to copy one image to the output dataframe / table:
What you see is unfortunately expected, the Python script nodes do not support storing images in table cells. This is a feature request that’s quite high on our priority list, but we didn’t get to work on it yet.
For the time being, you could write PNGs to a temporary folder, store the file names in a column in the output table of your Python script and then use the “Read Images” node to read the images and continue with those as a workaround.
That’s a great idea!
The Python Code is part of a component which is shared to various colleagues. So it would be good to store the data in the local workflow folder/path.
Just make sure that you have an actual PNG file (binary) and store it as a BLOB data type in SQLite. If you read it back to KNIME make sure the column “data” with the image is defined as a PNG file:
Very good question, we’ll make paths to the workflow data area, KNIME’s temp folder etc available to Python scripts and nodes soon, but for now you could also use the “Extract Context Properties” node to access the path like I did in this example workflow include_python_library_in_workflow – KNIME Community Hub