Skip to content

Commit fee72a7

Browse files
docs: document mask methods (#54)
1 parent 56904fe commit fee72a7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+238
-187
lines changed

docs/Features/Comparison/Addition.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ _Makes an addition between two images._
66

77
[Check options and parameters of `add` method](https://image-js.github.io/image-js-typescript/classes/Image.html#add 'github.io link')
88

9-
:::caution
10-
This method works only with images.
11-
:::
12-
139
`add` method, opposed to [subtraction](./Subtraction.md 'internal link on subtract'), takes another Image and makes an addition between each respective pixel value.
1410
It works like this:
1511

docs/Features/Comparison/Comparison.md

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,12 @@ sidebar_position: 0
55
Comparison methods are methods that compare other images for feature matching or change detection by subtraction or addition of image values etc.
66
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.
77

8-
### Methods that can be applied on Images only
9-
10-
- [`add`](./Addition.md 'internal link on add')
11-
12-
- [`hypotenuse`](./Hypotenuse.md 'internal link on hypotenuse')
13-
14-
### Methods that can be applied on Masks only
15-
16-
- [and](./Logical%20conjunction.md 'internal link on and')
17-
18-
- [or](./Logical%20disjunction.md 'internal link on or')
19-
20-
### Methods that can be applied on Images and Masks
21-
22-
- [`subtract`](./Subtraction.md 'internal link on subtract')
8+
### Methods
9+
10+
| Can be applied on | Images | Masks |
11+
| ------------------------------------------------------------------------------- | -------- | -------- |
12+
| [Addition(`add`)](./Addition.md 'internal link on add') | ✅ | ❌ |
13+
| [Subtraction( `subtract` )](./Subtraction.md 'internal link on subtract') | ✅ | ✅ |
14+
| [Hypotenuse( `hypotenuse` )](./Hypotenuse.md 'internal link on hypotenuse') | ✅ | ❌ |
15+
| [Logical conjunction(`and`)](./Logical%20conjunction.md 'internal link on and') | ❌ | ✅ |
16+
| [Logical disjunction(`or`)](./Logical%20disjunction.md 'internal link on or') | ❌ | ✅ |

docs/Features/Comparison/Hypotenuse.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@ sidebar_position: 30
44

55
_Calculates the euclidean distance of two points between two images._
66

7-
[Check options and parameters of `hypotenuse` method](https://image-js.github.io/image-js-typescript/classes/Image.html#hypotenuse 'github.io link')
8-
9-
:::caution
10-
This method works only with images.
11-
:::
7+
[🖼️ Image options and parameters of `hypotenuse` method](https://image-js.github.io/image-js-typescript/classes/Image.html#hypotenuse 'github.io link')
128

139
A "hypotenuse filter" is using two compatible images to change values of each pixel by calculating [Euclidean distance](https://en.wikipedia.org/wiki/Euclidean_distance 'wikipedia link on Euclidean distance') with the formula:
1410

docs/Features/Comparison/Logical conjunction.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@ sidebar_position: 100
44

55
_Makes a logical conjunction between masks._
66

7-
[Check options and parameters of `and` method](https://image-js.github.io/image-js-typescript/classes/Mask.html#and 'github.io link')
8-
9-
:::caution
10-
This method works only with masks.
11-
:::
7+
[🎭 Mask options and parameters of `and` method](https://image-js.github.io/image-js-typescript/classes/Mask.html#and 'github.io link')
128

139
`and` method performs a [logical conjunction](https://en.wikipedia.org/wiki/Logical_conjunction 'wikipedia link on logical conjunction') between bits of two masks.
1410

docs/Features/Comparison/Logical disjunction.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@ sidebar_position: 110
44

55
_Makes a logical disjunction between masks._
66

7-
[Check options and parameters of `or` method](https://image-js.github.io/image-js-typescript/classes/Mask.html#or 'github.io link')
8-
9-
:::caution
10-
This method works only with masks
11-
:::
7+
[🎭 Mask options and parameters of `or` method](https://image-js.github.io/image-js-typescript/classes/Mask.html#or 'github.io link')
128

139
`or` method performs a [logical disjunction](https://en.wikipedia.org/wiki/Logical_disjunction 'wikipedia link on logical disjunction') between bits of two masks.
1410

docs/Features/Comparison/Subtraction.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ sidebar_position: 20
44

55
_Makes a subtraction between two images._
66

7-
[Check options and parameters of `subtract` method](https://image-js.github.io/image-js-typescript/classes/Image.html#subtract 'github.io link')
7+
[🖼️ Image options and parameters of `subtract` method](https://image-js.github.io/image-js-typescript/classes/Image.html#subtract 'github.io link')
8+
[🎭 Mask options and parameters of `subtract` method](https://image-js.github.io/image-js-typescript/classes/Mask.html#subtract 'github.io link')
89

910
Method called `subtract`, as the name suggests, takes another Image(or Mask) and makes a subtraction between each respective bit.
1011
It works like this:
@@ -26,6 +27,10 @@ Both masks must have the same size for compatibility reasons. Images must have t
2627

2728
### Parameters and default values
2829

30+
:::info
31+
Parameters and options for Images and Masks are the same.
32+
:::
33+
2934
- `other`
3035

3136
- `options`
@@ -35,3 +40,7 @@ Both masks must have the same size for compatibility reasons. Images must have t
3540
| Property | Required | Default value |
3641
| ---------------------------------------------------------------------------------------------------------- | -------- | ------------- |
3742
| [`absolute`](https://image-js.github.io/image-js-typescript/interfaces/SubtractImageOptions.html#absolute) | no | `false` |
43+
44+
:::info
45+
The method is also available for Masks.
46+
:::

docs/Features/Fill.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[Check options and parameters of `fill` method](https://image-js.github.io/image-js-typescript/classes/Image.html#fill 'github.io link')
1+
[🎭 Mask options and parameters of `fill` method](https://image-js.github.io/image-js-typescript/classes/Image.html#fill 'github.io link')
22

33
Fill method fills the whole Mask with a designated value.
44
It works like this:

docs/Features/Filters/Blur.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,11 @@
22
sidebar_position: 30
33
---
44

5-
import BlurDemo from './blur.demo.tsx'
5+
import BlurDemo from './demos/blur.demo.tsx'
66

77
_Reduces image details and sharpness by averaging or mixing neighboring pixel values._
88

9-
[Check options and parameters of `blur` method](https://image-js.github.io/image-js-typescript/classes/Image.html#blur 'link on github io')
10-
11-
:::caution
12-
This method works only with images.
13-
:::
9+
[🖼️ Image options and parameters of `blur` method](https://image-js.github.io/image-js-typescript/classes/Image.html#blur 'link on github io')
1410

1511
Blur, also known as average blur or box blur, is a simple image processing technique used to reduce noise and smooth out images. It involves replacing the color value of a pixel with the average color value of its neighboring pixels within a specified window or kernel. This process effectively blurs the image and reduces high-frequency noise.
1612

docs/Features/Filters/Derivative.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,11 @@
22
sidebar_position: 70
33
---
44

5-
import DerivativeDemo from './derivative.demo.tsx'
6-
import GradientDemo from './gradient.demo.tsx'
5+
import DerivativeDemo from './demos//derivative.demo.tsx'
76

87
_Gradient filter but using predefined kernels._
98

10-
[Check options and parameters of `derivative` method](https://image-js.github.io/image-js-typescript/classes/Image.html#derivativeFilter 'link on github io')
11-
12-
:::caution
13-
This method works only with images.
14-
:::
9+
[🖼️ Image options and parameters of `derivative` method](https://image-js.github.io/image-js-typescript/classes/Image.html#derivativeFilter 'link on github io')
1510

1611
Derivative filter is a special case of a gradient filter, therefore it uses gradient algorithm. However, the key difference are the kernels used in this very algorithm. In ImageJS there are three distinguished kernels: [Sobel](https://en.wikipedia.org/wiki/Sobel_operator 'wikipedia link on Sobel kernel'), [Scharr](https://en.wikipedia.org/wiki/Sobel_operator#Alternative_operators 'wikipedia link on Scharr operator') and [Prewitt](https://en.wikipedia.org/wiki/Prewitt_operator 'wikipedia link on Prewitt kernel').
1712

docs/Features/Filters/Filters.md

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,18 @@
22
sidebar_position: 0
33
---
44

5-
# Filters
6-
75
[Image filters](https://en.wikipedia.org/wiki/Digital_image_processing#Filtering 'wikipedia link on image filtering') are techniques or algorithms applied to digital images in order to modify their appearance, enhance certain features, or extract specific information from them. Image filters work by altering the pixel values of an image based on predefined mathematical operations or transformations. These filters can be used for various purposes, such as artistic effects, noise reduction, image enhancement, edge detection, and more.
86

9-
### Methods that can be applied on Images only
10-
11-
- [Grayscale](./Grayscale.md 'internal link on grayscale')
12-
13-
- [Blur](./Blur.md 'internal link on blur')
14-
15-
- [gaussianBlur](./Gaussian%20Blur.md 'internal link on gaussianBlur')
16-
17-
- [Gradient](./Gradient.md 'internal link on gradient')
18-
19-
- [Derivative](./Derivative.md 'internal link on derivative')
20-
21-
- [Median](./Median.md 'internal link on median')
22-
23-
- [level](./Level.md 'internal link on level')
24-
25-
- [pixelate](./Pixelate.md 'internal link on pixelate')
26-
27-
### Methods that can be applied on Images or Masks
28-
29-
- [invert](./Invert.md 'internal link on invert')
7+
### Methods
8+
9+
| Can be applied on | Images | Masks |
10+
| -------------------------------------------------------------------------------- | ------- | -------- |
11+
| [Invert(`add`)](./Invert.md 'internal link on invert') | ✅ | ✅ |
12+
| [Grayscale( `grey` )](./Grayscale.md 'internal link on grayscale') | ✅ | ❌ |
13+
| [Gradient(`gradient` )](./Gradient.md 'internal link on gradient') | ✅ | ❌ |
14+
| [Derivative(`derivative`)](./Derivative.md 'internal link on derivative') | ✅ | ❌ |
15+
| [Median(`median`)](./Median.md 'internal link on median') | ✅ | ❌ |
16+
| [Pixelate(`pixelate`)](./Pixelate.md 'internal link on pixelate') | ✅ | ❌ |
17+
| [Blur(`blur`)](./Blur.md 'internal link on blur') | ✅ | ❌ |
18+
| [Gaussian(`gaussianBlur`)](./Gaussian%20Blur.md 'internal link on gaussianBlur') | ✅ | ❌ |
19+
| [Level(`level`)](./Level.md 'internal link on level') | ✅ | ❌ |

0 commit comments

Comments
 (0)