-
-
Notifications
You must be signed in to change notification settings - Fork 275
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
How do you resize an Image
without making a copy?
#712
Comments
That's currently not possible, it needs the new memory to copy into. |
Can you explain the issue? If you can transform the entire image with imageTransform without creating a new image then Image is mutable. |
I'll take a look at doing an in-place minimize function. |
Ok, I added a "resize" function, with the same arguments as resizeCopy. It will do the resize within the existing memory of the image as long as the requested size fits into the memory. If the requested size needs more memory, it will fall back to resizeCopy. |
That sounds perfect! 🤩 |
Keep in mind I haven't tested it a lot. I'm sure there will be edge cases where the wrong pixels will be sampled. Can always go back to it if issues come up, but the solution to those problems would likely be a copy of the memory like resizeCopy so fingers crossed this is good enough. |
No description provided.
The text was updated successfully, but these errors were encountered: