How to load an Pillow opened image into image-rs
#3090
-
Hi thanks for creating So i have an image opened with Is it possible to do so without saving the file to the disk and then loading it with |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Just use a https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.Image.save |
Beta Was this translation helpful? Give feedback.
Just use a
BytesIO
or similar withImage.save
to keep the image in-memory and then pass the bytes to Rust as a#[pyfunction]
input to load however you like on the Rust side. This isn't any different to how you might share an in-memory image with other Python libraries.https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.Image.save