You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Call ImageFilter.BoxBlur or ImageFilter.GaussianBlur with the radius parameter set to a 2-tuple containing an X and Y radius.
What did you expect to happen?
The blur operation should use different radii for the X and Y dimensions. If one of the dimensions is zero, then the blur should only be done in the other axis.
What actually happened?
This is not supported, per documentation (the radius must be a single number).
What are your OS, Python and Pillow versions?
OS: Linux
Python: 3.11
Pillow: 9.5.0
Example code
# im is an image# This worksim.filter(ImageFilter.GaussianBlur(32))
# This doesn't workim.filter(ImageFilter.GaussianBlur((32, 16)))
Other notes
It looks like there's already internal code for doing single-dimensional box blur; making the 2-dimensional blur functions (which are exposed to Python) use different radii per dimension should be pretty easy. See this code:
What did you do?
Call
ImageFilter.BoxBlur
orImageFilter.GaussianBlur
with theradius
parameter set to a 2-tuple containing an X and Y radius.What did you expect to happen?
The blur operation should use different radii for the X and Y dimensions. If one of the dimensions is zero, then the blur should only be done in the other axis.
What actually happened?
This is not supported, per documentation (the radius must be a single number).
What are your OS, Python and Pillow versions?
Example code
Other notes
It looks like there's already internal code for doing single-dimensional box blur; making the 2-dimensional blur functions (which are exposed to Python) use different radii per dimension should be pretty easy. See this code:
Pillow/src/libImaging/BoxBlur.c
Lines 266 to 281 in a5b0256
I would probably be happy to send in a PR, if this is a feature that you would welcome -- let me know.
The text was updated successfully, but these errors were encountered: