pillow-simd
pillow-simd copied to clipboard
Pillow-simd as a C shared library
What did you do?
I have read C source
What did you expect to happen?
Boom! And all over the world are happy!
What actually happened?
Boom failed.
Can you please provide some tools / instructions / documentation for extracting pillow-simd as a C shared library? I think it's a good goal to bring this blazing-fast image tool to JVM world.
Pillow is a python-only library. There are no plans to support other languages. There was at least one attempt from @peterhj to port Pillow-SIMD to Rust:
https://github.com/peterhj/pillow_simd_ffi https://github.com/peterhj/pillow-simd/commits/bootstrap-imaging
Yes, to elaborate a bit further, only the "libImaging" component of Pillow/Pillow-SIMD is rather amenable to packaging as a C library. The "bootstrap-imaging" branch @homm pointed to removes some Python specific parts of libImaging so it can be separately compiled.
There is some functionality in libImaging that is more difficult to separate cleanly from Python, namely the encoder and decoder parts.
Here's a build script and a small C wrapper just for the image object and resampling: https://github.com/allegory-software/allegory-sdk/tree/dev/c/pillow_simd. Looks like you can wrap it easily without having to touch the upstream code.