Resampling filters are not order-independent under 90-degree rotation, a control test shows
A DEV Community author tested whether a separable image resampler commutes with a 90-degree transpose, which it should in exact arithmetic. Using seven photos, four filters and three scales, the author compared transposing before versus after resizing, with NEAREST as a control that must match exactly. NEAREST passed in all 21 cases, validating the harness. Interpolating filters such as LANCZOS diverged by up to 17 code values on about 17.5% of pixels at 2x. The author attributes the discrepancy to intermediate 8-bit rounding in the two resampling passes, which occur in a different order depending on the path.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in