Skip to content

Fix BOX resampling dropping source pixels on window boundaries - #10165

Closed
aclark4life wants to merge 3 commits into
mainfrom
box-filter-edge-pixels
Closed

aclark4life wants to merge 3 commits into
mainfrom
box-filter-edge-pixels

Conversation

@aclark4life

@aclark4life aclark4life commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Fixes #9939.

  • When a source pixel center lies exactly on the boundary between two output pixels (for example 2755 -> 688, or 1837 -> 306), floating point rounding could make both neighbouring BOX windows reject it, so the pixel was dropped from the result.
  • Shift the BOX filter edges, and the matching window range rounding in precompute_coeffs, by a small tolerance so that boundary pixels are consistently assigned to exactly one output pixel.
  • Add a test checking that every source pixel contributes to the output for several affected sizes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@radarhere

Copy link
Copy Markdown
Member

Be aware of the other suggested solution, #9949

@aclark4life aclark4life added the Bug Any unexpected behavior, until confirmed feature. label Oct 11, 2026
@radarhere

Copy link
Copy Markdown
Member

Closing, as #9949 would seem to be the more theoretically solid solution.

@radarhere radarhere closed this Oct 29, 2026
@hugovk
hugovk deleted the box-filter-edge-pixels branch October 29, 2026 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Any unexpected behavior, until confirmed feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BOX filter missed some edge-case pixels

2 participants