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

Modified docstring for GaussianBlur #5539

Merged
merged 2 commits into from
Jun 28, 2021
Merged

Conversation

kdpenner
Copy link
Contributor

Changes proposed in this pull request:

  • The argument for GaussianBlur is radius. The canonical name for the parameter is standard deviation. The value for the standard normal distribution at a given radius is a function of standard deviation.
  • GaussianBlur doesn't convolve the image with a Gaussian kernel. It uses a kernel that when applied iteratively approximates a Gaussian kernel.

The changes improve the precision of the documentation.

@radarhere
Copy link
Member

@homm you wrote the C implementation in #961. Did you want to quickly review this?

src/PIL/ImageFilter.py Outdated Show resolved Hide resolved
@@ -149,9 +149,10 @@ def filter(self, image):


class GaussianBlur(MultibandFilter):
"""Gaussian blur filter.
"""Blurs the image with an extended box filter, which approximates a
Gaussian kernel.
Copy link
Member

Choose a reason for hiding this comment

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

Is it worth to mention that approximation is very accurate?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Instead of "very accurate" I prefer to give a notion of the accuracy. In this case it depends on a few variables so I put in the link in the C header.

@hugovk hugovk merged commit bdc87f6 into python-pillow:master Jun 28, 2021
@kdpenner kdpenner deleted the gaussian-doc branch June 29, 2021 15:07
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.

None yet

4 participants