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

feat: add a sum filter #384

Closed EscapedGibbon closed 1 year ago

EscapedGibbon commented 1 year ago

close: https://github.com/image-js/image-js-typescript/issues/320

targos commented 1 year ago

I would have called it "add", in reference to the matlab method (https://ch.mathworks.com/help/images/ref/imadd.html) and also this is the counterpart of subtract.

targos commented 1 year ago

@stropitek not sure why you're mentioning mask here. The PR doesn't touch anything on mask code.

stropitek commented 1 year ago

not sure why you're mentioning mask here. The PR doesn't touch anything on mask code.

It's because the subtract method exists on Mask and to be on par we could implement the sum method as well. But to me the concept of doing sums and subtractions on masks seems kind of strange. I don't know for which use case the subtract method exists in the first place.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (e10ab1e) 98.64% compared to head (6740a0e) 98.64%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #384 +/- ## ======================================= Coverage 98.64% 98.64% ======================================= Files 222 223 +1 Lines 5741 5759 +18 Branches 1216 1217 +1 ======================================= + Hits 5663 5681 +18 Misses 75 75 Partials 3 3 ``` | [Files Changed](https://app.codecov.io/gh/image-js/image-js-typescript/pull/384?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=image-js) | Coverage Δ | | |---|---|---| | [src/Image.ts](https://app.codecov.io/gh/image-js/image-js-typescript/pull/384?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=image-js#diff-c3JjL0ltYWdlLnRz) | `100.00% <100.00%> (ø)` | | | [src/compare/add.ts](https://app.codecov.io/gh/image-js/image-js-typescript/pull/384?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=image-js#diff-c3JjL2NvbXBhcmUvYWRkLnRz) | `100.00% <100.00%> (ø)` | | | [src/compare/index.ts](https://app.codecov.io/gh/image-js/image-js-typescript/pull/384?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=image-js#diff-c3JjL2NvbXBhcmUvaW5kZXgudHM=) | `100.00% <100.00%> (ø)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

stropitek commented 1 year ago

image.add(otherImage) should be possible as well