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

Change default resize resampling filter from NEAREST to BICUBIC #4255

Merged
merged 3 commits into from Dec 19, 2019

Conversation

homm
Copy link
Member

@homm homm commented Dec 7, 2019

I believe this is much convenient in most cases, which makes Pillow much user-friendly.

@radarhere radarhere changed the title Change default resize resampling filter Change default resize resampling filter from NEAREST to BICUBIC Dec 7, 2019
@homm
Copy link
Member Author

homm commented Dec 16, 2019

@python-pillow/pillow-team
Guys, this is a very bold but I think necessary change. Image.NEAREST is the most useless resampling filter, this default in truth makes the filter argument mandatory in most cases. Most of the users are annoyed by this and this is what we can change is such great release. Do you have any thoughts?

@wiredfool
Copy link
Member

Makes sense to me.

@aclark4life
Copy link
Member

@homm Go for it, pending coordination with @hugovk and @radarhere and maybe some extra "we're doing this" type announcements preceding the release (presumably Jan 1), particularly if it could break existing usage.

@homm
Copy link
Member Author

homm commented Dec 16, 2019

Actually, there are ImageOps.pad(), ImageOps.scale() and ImageOps.fit() functions which also uses Image.NEAREST as default. I think we should change it too.

Another question is Image.Image.rotate() and Image.Image.transform() and in this case I'm not sure.

@hugovk
Copy link
Member

hugovk commented Dec 17, 2019

Normally we would want to put deprecation warnings where possible, but that would not have had much effect here.

The next release is a major, breaking release, so improving the default is fine. We're including it in the release notes, which I think is enough here.

Should we mention in the release notes something along the lines that performance is slower but with improved downscaling and upscaling quality?

@homm
Copy link
Member Author

homm commented Dec 17, 2019

@hugovk Maybe the link to filters description would be enough? https://pillow.readthedocs.io/en/stable/handbook/concepts.html#concept-filters

@hugovk
Copy link
Member

hugovk commented Dec 17, 2019

Yep, looks good.

src/PIL/Image.py Outdated Show resolved Hide resolved
skip-checks: true
@homm
Copy link
Member Author

homm commented Dec 17, 2019

@radarhere done

@homm homm merged commit 6d75a67 into python-pillow:master Dec 19, 2019
@homm homm deleted the default-resample-filter branch December 19, 2019 13:38
@radarhere
Copy link
Member

I've created #5411 to revert this for special image modes, since they don't currently support any resampling other than NEAREST.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants