Skip to content

Commit 126ade4

Browse files
committed
docs: document more differences in apis and change default demo image
1 parent 88543a4 commit 126ade4

File tree

3 files changed

+33
-8
lines changed

3 files changed

+33
-8
lines changed

blog/release.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,8 @@ Several methods have been renamed for consistency:
204204

205205
`img.setValue()` ➡️ `img.setValueByIndex()`
206206

207+
`img.setChannel()` ➡️ `img.fillChannel()`
208+
207209
**Other methods**:
208210

209211
`img.getLocalMaxima()` ➡️ `img.getExtrema()`
@@ -234,6 +236,12 @@ Several methods have been renamed for consistency:
234236

235237
`img.monotoneChainConvexHull()` ➡️ `mask.getConvexHull()`
236238

239+
`img.getMin()` & `img.getMax()` ➡️ `img.getMinMax()`
240+
241+
`img.getMean()` ➡️ `img.mean()`
242+
243+
`img.getMedian()` ➡️ `img.median()`
244+
237245
### Compatibility requirements
238246

239247
- Node.js: 18+ (previously 14+)
@@ -259,6 +267,7 @@ The following deprecated features have been removed:
259267
- `getClosestCommonParent()` and `getRelativePosition()` have been removed.
260268
- `getSimilarity()` and `getIntersection()` have been removed.
261269
- `paintPolygons()` and `paintPolylines()`have been removed. Use [`drawPolygon()`](https://image-js.github.io/image-js/classes/index.Image.html#drawpolygon 'API link on drawPolygon')/ [`drawPolyline()`](https://image-js.github.io/image-js/classes/index.Image.html#drawpolyline 'API link on drawPolyline') + a `for` loop.
270+
- `getMoment()` has been removed.
262271

263272
#### ROIs and its management
264273

@@ -352,6 +361,20 @@ const corrected = image.correctColor(measured, reference);
352361

353362
**Use cases**: Camera calibration, white balance correction, matching images from different devices, scientific imaging standardization.
354363

364+
### `variance()`
365+
366+
A function that calculates image's [variance](https://en.wikipedia.org/wiki/Variance 'wikipedia link on variance') has been added.
367+
368+
```ts
369+
// Calculate variance for entire image
370+
const variance = img.variance();
371+
// Returns: Array of variance values for each channel [R_variance, G_variance, B_variance]
372+
```
373+
374+
It computes the variance of pixel values for each channel in the image. Variance measures how spread out the pixel values are from the mean - higher variance indicates greater variation in pixel intensities, while lower variance suggests more uniform regions.
375+
376+
**Use cases**: Image quality assessment, texture analysis, noise detection, region comparison.
377+
355378
### `increaseContrast()`
356379

357380
This function increases image contrast by stretching the pixel value range to use the full available dynamic range.

project-words.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,5 @@ Ssim
3737
Dssim
3838
mssim
3939
GREYA
40+
Polylines
41+
anonymization

src/demo/contexts/demo/defaultImages.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ const morphologyMaskUrl =
99
export const defaultImages: UrlOption[] = [
1010
{
1111
type: 'url',
12-
value: `${standardUrl}/lenna.png`,
13-
label: 'Lenna',
12+
value: `${standardUrl}/mandrill.png`,
13+
label: 'Mandrill',
1414
imageType: 'image',
1515
},
1616
{
@@ -25,12 +25,6 @@ export const defaultImages: UrlOption[] = [
2525
label: 'Standard boat',
2626
imageType: 'image',
2727
},
28-
{
29-
type: 'url',
30-
value: `${standardUrl}/mandrill.png`,
31-
label: 'Mandrill',
32-
imageType: 'image',
33-
},
3428
{
3529
type: 'url',
3630
value: `${standardUrl}/peppers.png`,
@@ -43,6 +37,12 @@ export const defaultImages: UrlOption[] = [
4337
label: 'House',
4438
imageType: 'image',
4539
},
40+
{
41+
type: 'url',
42+
value: `${standardUrl}/lenna.png`,
43+
label: 'Lenna',
44+
imageType: 'image',
45+
},
4646
];
4747

4848
export const defaultMasks: UrlOption[] = [

0 commit comments

Comments
 (0)