Skip to content

Commit c0fa4d6

Browse files
EscapedGibbonstropitek
authored andcommitted
docs wip write a temp version of subtract and fix minor errors
1 parent beebf62 commit c0fa4d6

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed
Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,23 @@
1-
Method called `subtract` ,as the name suggests, takes another mask and makes a subtraction between each respective bit of the mask.
1+
Method called `subtract` ,as the name suggests, takes another image and makes a subtraction between each respective bit of both images.
22
It works like this:
33

44
```ts
5-
let image = new Mask(3, 3, {
5+
let image = new Image(3, 3, {
66
data: new Uint8Array([1, 1, 1, 1, 1, 1, 1, 1, 1]),
77
});
8-
let mask2 = new Mask(3, 3, {
8+
let image2 = new Image(3, 3, {
99
data: new Uint8Array([1, 1, 1, 2, 2, 2, 2, 2, 2]),
1010
});
11-
mask = mask.subtract(mask2);
12-
// expect mask to equal [0,0,0,1,1,1,1,1,1]
11+
mask = image.subtract(image2);
12+
// expect image to equal [0,0,0,1,1,1,1,1,1]
1313
```
1414

1515
:::caution
16-
Masks must have the same size for compatibility reasons.
17-
:::
18-
19-
:::info
20-
Mask method calls already preexisting `subtract` function. To learn more about how the function works click on this link(link)
16+
Images must have the same size for compatibility reasons.
2117
:::
2218

2319
### Parameters and default values
2420

25-
- [`mask`](https://image-js.github.io/image-js-typescript/classes/Mask.html#subtract 'github.io link')
21+
- [`image`](https://image-js.github.io/image-js-typescript/classes/Image.html#subtract 'github.io link')
2622

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

docs/API reference/Image/Morphology/morphologicalGradient.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import MorphGradientDemo from './morphologicalGradient.demo.tsx'
44

55
[The morphological gradient](https://en.wikipedia.org/wiki/Morphological_gradient 'wikipedia link on morphological gradient') is a mathematical operation used in image processing and mathematical morphology to highlight the boundaries of objects or regions within an image.
66
It is a fundamental concept in morphological image analysis and is often used for tasks such as edge detection and image segmentation.
7-
The morphological gradient is based on the difference between an image after [dilation](./Dilate.md 'internal link on dilation') and the same image after [erosion](./Erode.md 'intenal link on erosion').
7+
The morphological gradient is based on the difference between an image after [dilation](./Dilate.md 'internal link on dilation') and the same image after [erosion](./Erode.md 'internal link on erosion').
88

99
<MorphGradientDemo />
1010

0 commit comments

Comments
 (0)