pillow-simd icon indicating copy to clipboard operation
pillow-simd copied to clipboard

Pillow-simd as a C shared library

Open up-to-you opened this issue 6 years ago • 3 comments

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.

up-to-you avatar May 06 '18 14:05 up-to-you

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

homm avatar May 07 '18 09:05 homm

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.

peterhj avatar May 07 '18 21:05 peterhj

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.

capr avatar Feb 02 '22 10:02 capr