Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow GaussianBlur and BoxBlur to accept a sequence of x and y radii #7336

Merged
merged 2 commits into from
Aug 25, 2023

Conversation

radarhere
Copy link
Member

Resolves #7321

Allows specifying a different radius for X and Y for ImageFilter's GaussianBlur and BoxBlur, e.g. ImageFilter.GaussianBlur((32, 16)) and ImageFilter.BoxBlur((32, 16)).

This is in addition to the existing single number, ImageFilter.GaussianBlur(16) and ImageFilter.BoxBlur(16).

for (i = 1; i < n; i++) {
ImagingHorizontalBoxBlur(imOut, imOut, radius);
ImagingHorizontalBoxBlur(imOut, imOut, xradius);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could skip passes if it’s radius == 0

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. I've pushed a commit

@hugovk hugovk merged commit c68bf7d into python-pillow:main Aug 25, 2023
@radarhere radarhere deleted the blur branch August 25, 2023 09:21
radarhere added a commit to radarhere/Pillow that referenced this pull request Oct 7, 2023
hugovk added a commit that referenced this pull request Oct 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gaussian/Box blur with different X and Y radius
3 participants