wagtail / Willow

A wrapper that combines the functionality of multiple Python image libraries into one API
https://willow.wagtail.org/
BSD 3-Clause "New" or "Revised" License
274 stars 53 forks source link

Affine transformations API #72

Open kaedroho opened 5 years ago

kaedroho commented 5 years ago

This API would allow us to combine many resize, crop, rotation, scaling, etc operations and apply them all in a single pass.

This would be useful for image editors in Wagtail. The operations that were added by the user can be combined with the operations added in the template and applied together. This is good for both performance and quality as the image would only need to be resampled once.

A minimal implementation would only require exposing the affine transformation operations from Pillow/Wand so we can use them from Wagtail. As a bonus, it might be nice to think about whether we should create an AffineMatrix type to help with constructing and combining matrices for the various operations.