Skip to content

Add the ability to choose the interpolation mode when resizing an image #1057

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

Merged
merged 2 commits into from
Jul 11, 2025

Conversation

jSdCool
Copy link
Contributor

@jSdCool jSdCool commented Apr 22, 2025

Added the ability to choose witch interpolation mode to use when resizing an image.

To do this there is a new overload for PImage.resize() that takes 3 ints (width, height, interpolation mode) there are also 3 new PConstants for the mode they are: NEAREST_NEIGHBOR, BILINEAR, and BICUBIC. They have a value of 0 1 and 2 respectively.

This has been accomplished by utilizing the different interpolation modes provided by the java awt library that was already used for resizing images.

@Stefterv
Copy link
Collaborator

Hi @jSdCool Thank you for the contribution, a few things of note:

  • Please make sure your PR is based on the new repo and not the old one.
  • keywords.txt is generated so should not be edited

@jSdCool
Copy link
Contributor Author

jSdCool commented Apr 23, 2025

I originally developed this feature before this repo was created and have made sure that everything was updated for the new repo, hence [e96c679].(e96c679)
If there are any specific adjustment that need to be made or processes that should be used that I am not aware of, please let me know.

@SableRaf
Copy link
Collaborator

Hi @jSdCool. You'll want to rebase your local branch onto the latest commit on this repository's main branch. That will update your branch so your changes sit on top of the most recent work in the repo.

There’s a guide here if you need it: https://www.atlassian.com/git/tutorials/rewriting-history/git-rebase

@jSdCool
Copy link
Contributor Author

jSdCool commented Apr 24, 2025

Thanks that was helpful, did I do it right?

@SableRaf
Copy link
Collaborator

Hi @jSdCool. You're close but this still doesn’t look quite right. Please make a fresh clone of the new repository and reapply your changes there. That will make sure everything is clean and ready to review. Thanks for your efforts!

@jSdCool
Copy link
Contributor Author

jSdCool commented Apr 27, 2025

OK, should be clean now

Copy link
Collaborator

@Stefterv Stefterv left a comment

Choose a reason for hiding this comment

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

All good, with one quick fix but not necessarily blocking

@Stefterv Stefterv added this to the 4.4.4 milestone Apr 27, 2025
@SableRaf SableRaf moved this to Testing in Processing Roadmap Apr 27, 2025
@SableRaf SableRaf moved this from Testing to In progress in Processing Roadmap Apr 27, 2025
@Stefterv Stefterv modified the milestones: 4.4.4, 4.4.5 May 12, 2025
@SableRaf SableRaf merged commit 489c7e9 into processing:main Jul 11, 2025
@github-project-automation github-project-automation bot moved this from In progress to Completed in Processing Roadmap Jul 11, 2025
@SableRaf
Copy link
Collaborator

Thanks for your contribution @jSdCool! This is a great addition to Processing 💙

@all-contributors please add @jSdCool for code and documentation

Copy link
Contributor

@SableRaf

I've put up a pull request to add @jSdCool! 🎉

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

Successfully merging this pull request may close these issues.

3 participants