Skip to content
This repository was archived by the owner on Jul 26, 2025. It is now read-only.

Conversation

@tpoisseau
Copy link
Contributor

@tpoisseau tpoisseau commented May 2, 2024

Refs: image-js/image-js#654


chirurgical fix, rework of #453

previous PR had lot of issues due to fix for bilinear interpolation breaking lot of tests for general worse results (only clear better results was for the opencv bilinear test).

better / worse are personal appreciation.

This PR fix resize with nearest interpolation by using transform matrix without change interpolateNearest function and adding small translation to compensate.
Changing interpolation function would break some tests but not for the best. I continue to think more work need to be done on this topic.

  • interpolateNearest should use floor I guess
  • compensate with translation may not be the best things to do
  • other resize interpolation should also use transform
  • maybe the algorithm for transform is not exactly right or be specific for each interpolation method

It's a lot of work to plan for really small, nearly impossible to see with the naked eye and lot of decision and estimation to do to actualize breaking tests or not.

@tpoisseau tpoisseau marked this pull request as ready for review May 2, 2024 12:27
@tpoisseau tpoisseau requested a review from targos May 2, 2024 12:27
Copy link
Member

@targos targos left a comment

Choose a reason for hiding this comment

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

It can ref https://github.com/image-js/image-js-typescript/issues/452, but it doesn't close it (only nearest-neighbor is fixed).

@tpoisseau tpoisseau force-pushed the 452-resize-method-doesnt-work-properly-try-2 branch from 6e8748a to 1944341 Compare May 2, 2024 12:52
@tpoisseau
Copy link
Contributor Author

Ok for refs instead closes.

@tpoisseau tpoisseau requested a review from targos May 2, 2024 13:26
@targos targos merged commit d80f4a7 into main May 3, 2024
@targos targos deleted the 452-resize-method-doesnt-work-properly-try-2 branch May 3, 2024 06:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants