image-js / image-js-typescript

Temporary repository to work on the migration of image-js to TypeScript
https://image-js.github.io/image-js-typescript/
MIT License
5 stars 5 forks source link

Threshold on 16 bits images is too slow #447

Closed lpatiny closed 4 months ago

lpatiny commented 4 months ago

The calculations of threshold based on the histogram is too slow if the images are 16 bits.

https://github.com/image-js/image-js-typescript/blob/main/src/operations/threshold.ts#L84

We should at least have an options to specify the number of slots to use for the histogram calculation and for me the default value should be 2**8.

The result by itself should barely change.

targos commented 4 months ago

The result by itself should barely change.

This seems wrong to me intuitively. We should discuss it in-person.

lpatiny commented 4 months ago

@moonayyur You may add this option but by default it can stay the same value as today.