image-rs / imageproc

Image processing operations
MIT License
723 stars 144 forks source link

Agree a sensible API for filtering so we can reduce the risk of frequent breaking changes to signatures #661

Open theotherphil opened 1 month ago

theotherphil commented 1 month ago

What functions should exist, should we provide simple wrapper functions, what code structure do we want, and what docs need to exist to ensure discoverability.

Related: what’s our policy for breaking changes - what warrants a rename or signature change and what doesn’t.

ripytide commented 1 month ago

Ditto https://github.com/image-rs/imageproc/pull/660#issuecomment-2134034460 I think the gradient one liner functions are poor for readability and maintainability and should be deprecated.

ripytide commented 1 month ago

I'd disagree with renaming filter_clamped to filter since shorter names are not always better names for code readability as the name filter hides that it clamps pixel sums unless you read the docs and so could become a foot-gun.

ripytide commented 1 month ago

Not to mention that all the gradient functions all currently only support GrayImage, and not color images. Supporting any image pixel would require repeating filter_clamped()'s trait bounds on every one of the one-liner functions which is not very maintainable and not an easy API to learn for new users.