Skip to content

Commit 430ef3c

Browse files
EscapedGibbonstropitek
authored andcommitted
docs: move add, subtract and hypotenuse to comparison folder
1 parent c3a4045 commit 430ef3c

File tree

6 files changed

+43
-8
lines changed

6 files changed

+43
-8
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Comparison methods are methods that compare other images for feature matching or change detection by subtraction or addition of image values etc.
2+
The specific reasons for comparing images depend on the application and the desired outcome. In many cases, it is also a valuable tool for identifying changes, isolating objects, enhancing features, and improving image quality for various purposes.
3+
4+
### Methods that can be applied on Images only
5+
6+
- [add](./add.md 'internal link on add')
7+
8+
- [hypotenuse](./hypotenuse.md 'internal link on hypotenuse')
9+
10+
### Methods that can be applied on Images and Masks
11+
12+
- [subtract](./subtract.md 'internal link on subtract')

docs/Features/Comparison/add.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[Check options and parameters of add method](https://image-js.github.io/image-js-typescript/classes/Image.html#add 'github.io link')
2+
3+
:::caution
4+
This method works only with images.
5+
:::
6+
7+
Method called `add`, opposed to [`subtract`](./subtract.md 'internal link on subtract'), takes another Image and makes an addition between each respective pixel.
8+
It works like this:
9+
10+
```ts
11+
let mask = new Image(3, 3, {
12+
data: new Uint8Array([1, 122, 122, 122, 122, 1, 1, 1, 1]),
13+
});
14+
let mask2 = new Image(3, 3, {
15+
data: new Uint8Array([1, 133, 133, 133, 0, 0, 50, 0, 1]),
16+
});
17+
mask = mask.subtract(mask2);
18+
// expect mask to equal [2,255,255,255,255,122,1,51,2]
19+
```
20+
21+
:::caution
22+
Images must have the same size, channel number and bit depth for compatibility reasons.
23+
:::
24+
25+
### Parameters and default values
26+
27+
- [`otherImage`](https://image-js.github.io/image-js-typescript/classes/Mask.html#subtract 'github.io link')
File renamed without changes.

docs/Features/Filters/subtract.md renamed to docs/Features/Comparison/subtract.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ let mask = new Mask(3, 3, {
88
data: new Uint8Array([1, 1, 1, 1, 1, 1, 1, 1, 1]),
99
});
1010
let mask2 = new Mask(3, 3, {
11-
data: new Uint8Array([1, 1, 1, 2, 2, 2, 2, 2, 2]),
11+
data: new Uint8Array([1, 1, 1, 0, 0, 0, 0, 0, 1]),
1212
});
1313
mask = mask.subtract(mask2);
14-
// expect mask to equal [0,0,0,1,1,1,1,1,1]
14+
// expect mask to equal [0,0,0,1,1,1,1,1,0]
1515
```
1616

1717
:::caution
@@ -20,7 +20,7 @@ Both masks must have the same size for compatibility reasons. Images must have t
2020

2121
### Parameters and default values
2222

23-
- [`mask`](https://image-js.github.io/image-js-typescript/classes/Mask.html#subtract 'github.io link')
23+
- [`other`](https://image-js.github.io/image-js-typescript/classes/Mask.html#subtract 'github.io link')
2424

2525
- [`options`](https://image-js.github.io/image-js-typescript/classes/Mask.html#subtract 'github.io link')
2626

docs/Features/Filters/Filters.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ sidebar_position: 0
2020

2121
- [Median](./Median.md 'internal link on median')
2222

23-
- [hypotenuse](./hypotenuse.md 'internal link on hypotenuse')
24-
2523
- [level](./level.md 'internal link on level')
2624

2725
- [pixelate](./Pixelate.md 'internal link on pixelate')
@@ -35,5 +33,3 @@ sidebar_position: 0
3533
### Methods that can be applied on Images or Masks
3634

3735
- [invert](./Invert.md 'internal link on invert')
38-
39-
- [subtract](./subtract.md 'internal link on subtract')

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)