Closed TadLeonard closed 5 years ago
Thanks for the kind words. I've added numpy-friendly functions in PR https://github.com/anibali/pywebp/pull/6 and released 0.1.0a11 to PyPI with the changes. You can now use the new imread
, imwrite
, mimread
, and mimwrite
functions with numpy arrays, similarly to how you would in imageio.
In my typical workflow, Pillow really offers nothing valuable to me. I keep my code in the NumPy/OpenCV world, and the PIL abstraction of images just isn't useful there. NumPy itself is actually a pretty great tool for doing a lot of common image processing tasks.
For that reason, it'd be pretty cool if
webp
supported NumPy arrays insave_image
,save_images
, and elsewhere. It shouldn't be terribly complicated to add this. It seems likewebp
needs a pointer to the raw, underlying data. You can definitely get that from aNumPy
array. You also need width and height, which you can get fromarray.shape[:2]
.Great project! The code itself looks super clean. Nice to see
Enum
getting used. Can't wait to replace imageio withwebp
in certain cases!