[Feature]: Generalize fast resize support beyond `u8`
#862 opened on Mar 27, 2026
Repository metrics
- Stars
- (675 stars)
- PR merge metrics
- (PR metrics pending)
Description
Extend the fast resize path so it can support additional pixel element types beyond u8.
Motivation
Many image-processing and ML workflows use pixel types other than u8, such as u16 or f32. Restricting the fast path to u8 limits reuse and makes the API less flexible for broader scientific, imaging, and inference workloads.
Proposed Solution
- Review the current fast resize implementation and its assumptions around element type and channel layout.
- Identify which additional types can be supported cleanly with the underlying resize backend.
- Add support incrementally, starting with the most practical types.
- Preserve a clear error path for unsupported combinations.
- Add tests and, if helpful, benchmarks comparing supported type paths.
Expected Outcome
The fast resize API becomes more generally useful while remaining explicit about which element types and channel layouts are supported.
✅ Acceptance Criteria
- At least one additional element type beyond
u8is supported, or the constraints are documented clearly. - Existing
u8behavior remains unchanged. - Tests cover supported new type combinations.
- Documentation clearly lists supported types and limitations.
Additional Context
This may depend on the capabilities and currently pinned version of the resize backend, so implementation scope should be validated before widening the public API too far.
Code Reference
// crates/kornia-imgproc/src/resize.rs ~207
// TODO: Find a way to generalise it further by supporting multiple types other than u8
🤝 Contribution Intent
- I plan to submit a PR to implement this feature
- I'm requesting this feature but not planning to implement it