imagecli icon indicating copy to clipboard operation
imagecli copied to clipboard

Improve performance of scale and resize

Open theotherphil opened this issue 6 years ago • 3 comments

theotherphil avatar Sep 13 '19 11:09 theotherphil

Can you provide more details? Resizing is one of my main use-case.

hbina avatar Sep 17 '21 01:09 hbina

This library uses the resizing functions from the image crate, which was not written to be particularly performant. A possibly unhelpfully vague answer here is to add some benchmarks for those functions in the image crate and look for ways to improve them.

theotherphil avatar Sep 29 '21 07:09 theotherphil

My prompt for creating this issue was the knowledge that the functions in the image crate for filtering images are far slower than they could be, and that the resizing functions share code with the filtering functions.

This benchmark gives an idea of how much performance the filtering functions in the image crate leave on the table (vs some functions in imageproc that have also not had all that much effort spent on their performance): https://github.com/image-rs/imageproc/blob/master/src/filter/mod.rs#L948

The resizing functions called by this library live here: https://github.com/image-rs/image/blob/master/src/imageops/sample.rs

theotherphil avatar Sep 29 '21 07:09 theotherphil