image-js / image-js-typescript

Temporary repository to work on the migration of image-js to TypeScript
https://image-js.github.io/image-js-typescript/
MIT License
5 stars 5 forks source link

fix: resize nearest #454

Closed tpoisseau closed 3 months ago

tpoisseau commented 3 months ago

Refs: https://github.com/image-js/image-js-typescript/issues/452


chirurgical fix, rework of https://github.com/image-js/image-js-typescript/pull/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.

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 commented 3 months ago

Ok for refs instead closes.