Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,17 @@ jobs:
node-version-matrix: '[24]'
upload-coverage: false
disable-test-package: true

check-kebab-case:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '24'

- name: Run kebab-case check
run: node checkFilenames.mjs
14 changes: 7 additions & 7 deletions blog/releases/1.0.md → blog/releases/1-0.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ The new `blackRois` and `whiteRois` properties provide more intuitive access to

For more information, please visit these tutorials:

- [Image segmentation with `threshold()` and `fromMask()`](../../docs/Tutorials/Image%20segmentation%20with%20threshold)
- [Image segmentation with `watershed()`](../../docs/Tutorials/Image%20segmentation%20with%20watershed)
- [Image segmentation with `threshold()` and `fromMask()`](../../docs/tutorials/image-segmentation-with-threshold)
- [Image segmentation with `watershed()`](../../docs/tutorials/image-segmentation-with-watershed)

### Sobel and Scharr filters

Expand Down Expand Up @@ -266,7 +266,7 @@ The following deprecated features have been removed:

- `countAlphaPixel()` - Use custom pixel counting with [`getPixel()`](https://api.image-js.org/classes/index.Image.html#getpixel 'API link on getPixel').
- `paintLabels()` and `roi.paint()` - Features have been removed due to dependency issues. We plan to add it back in future updates.
- `warpingFourPoints()` - Use [`getPerspectiveWarpMatrix()`](../../docs/Features/Geometry/Get%20Perspective%20Warp%20Matrix 'internal link on getPerspectiveWarp') + [`transform()`](#transform) instead.
- `warpingFourPoints()` - Use [`getPerspectiveWarpMatrix()`](../../docs/features/geometry/get-perspective-warp-matrix 'internal link on getPerspectiveWarp') + [`transform()`](#transform) instead.
- 32-bit color depth support and `abs()` have been removed.
- `CMYK` and `HSL` color models have been removed.
- `paintMasks()` has been removed. Use [`paintMask()`](https://api.image-js.org/classes/index.Image.html#paintmask 'API link on paintMask')+ a `for` loop.
Expand Down Expand Up @@ -303,7 +303,7 @@ const matrix = getPerspectiveWarp(sourcePoints);
const warped = img.transform(matrix);
```

For more details, [visit our tutorial](../../docs/Tutorials/Applying%20transform%20function%20on%20images 'internal link on transform function tutorial') on how image transformations work how they can be used.
For more details, [visit our tutorial](../../docs/tutorials/applying-transform-function-on-images 'internal link on transform function tutorial') on how image transformations work how they can be used.

### Bicubic interpolation

Expand All @@ -323,11 +323,11 @@ const resized = img.resize(800, 600, { interpolation: 'bicubic' });
const prewitt = img.derivative({ filter: 'prewitt' });
```

**Use cases**: Object detection, image segmentation, feature extraction. You can [learn more about it here](../../docs/Features/Morphology/Morphological%20Gradient 'internal link on morphological gradient').
**Use cases**: Object detection, image segmentation, feature extraction. You can [learn more about it here](../../docs/features/morphology/morphological-gradient 'internal link on morphological gradient').

### Migration from deprecated methods

`warpingFourPoints()` has been removed. Now you have [`getPerspectiveWarp()`](../../docs/Features/Geometry/Get%20Perspective%20Warp%20Matrix 'internal link on perspective warp') that returns a matrix that can be applied on the image of interest in a new `transform()`.
`warpingFourPoints()` has been removed. Now you have [`getPerspectiveWarp()`](../../docs/features/geometry/get-perspective-warp-matrix 'internal link on perspective warp') that returns a matrix that can be applied on the image of interest in a new `transform()`.

```ts
// Before
Expand All @@ -338,7 +338,7 @@ const matrix = getPerspectiveWarp(corners);
const warped = img.transform(matrix);
```

**Use cases**: Rectification of a perspective angle of an image. You can learn more about it [here](../../docs/Features/Geometry/Get%20Perspective%20Warp%20Matrix 'internal link on perspective warp').
**Use cases**: Rectification of a perspective angle of an image. You can learn more about it [here](../../docs/features/geometry/get-perspective-warp-matrix 'internal link on perspective warp').

### `merge()`

Expand Down
53 changes: 53 additions & 0 deletions checkFilenames.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import fs from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

function getAllFiles(dirPath) {
let nonKebabElements = [];
const entries = fs.readdirSync(dirPath, { withFileTypes: true });

const kebabCaseRegex = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;

for (const entry of entries) {
// Skip certain files/folders
if (
entry.name === '.DS_Store' ||
entry.name === 'images' ||
entry.name === 'demos' ||
entry.name === '_category_.json'
) {
continue;
}

// Get the name without extension for files, or full name for directories
const nameToTest = entry.isFile()
? path.parse(entry.name).name
: entry.name;

if (!kebabCaseRegex.test(nameToTest)) {
nonKebabElements.push(path.join(dirPath, entry.name));
}

// Recursively check subdirectories
if (entry.isDirectory()) {
const subDirResults = getAllFiles(path.join(dirPath, entry.name));
nonKebabElements = nonKebabElements.concat(subDirResults);
}
}

return nonKebabElements;
}

const folders = ['docs', 'blog'];

for (const folder of folders) {
const folderPath = path.join(__dirname, folder);
const nonKebabFiles = getAllFiles(folderPath);
if (nonKebabFiles.length !== 0) {
throw new Error(`Non-kebab-case files found:\n${nonKebabFiles.join('\n')}`);
}
}
console.log('All files have passed the check.');
18 changes: 0 additions & 18 deletions docs/Features/Comparison/Comparison.md

This file was deleted.

21 changes: 0 additions & 21 deletions docs/Features/Filters/Filters.md

This file was deleted.

18 changes: 0 additions & 18 deletions docs/Features/Geometry/Geometry.md

This file was deleted.

22 changes: 0 additions & 22 deletions docs/Features/Morphology/Morphology.md

This file was deleted.

19 changes: 0 additions & 19 deletions docs/Features/Operations/Operations.md

This file was deleted.

19 changes: 0 additions & 19 deletions docs/Features/Regions of interest/Regions of interest.md

This file was deleted.

3 changes: 0 additions & 3 deletions docs/Tutorials/_category_.json

This file was deleted.

File renamed without changes.
2 changes: 2 additions & 0 deletions docs/Features/Features.md → docs/basics/basics.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import DocCardList from '@theme/DocCardList';

# Basics

<DocCardList />
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ImageDemo from './image.demo.tsx'
import ImageDemo from './demos/image.demo.tsx'

# Working with Images

Expand Down Expand Up @@ -27,7 +27,7 @@ In the context of digital technology and computing, images are represented as a

The origin point has coordinates (0,0) and is located in the top-left corner of an image.

![Image coordinates](./workingWithImages/coordinatesImage.jpg)
![Image coordinates](./images/workingWithImages/coordinatesImage.jpg)

So, if we want to get a certain pixel on the image we will be counting the distance from image's top-left corner.

Expand All @@ -47,28 +47,28 @@ In ImageJS main properties of an image are:

- data: typed array with information about image's pixels.

- [Color model](../Glossary.md#color-model 'internal link on color model'): the abstract model of how pixel colors are formed.
- [Color model](../glossary.md#color-model 'internal link on color model'): the abstract model of how pixel colors are formed.

- [Bit depth](../Glossary.md#bit-depth 'internal link on bit depth'): number of bits allocated to each channel.
- [Bit depth](../glossary.md#bit-depth 'internal link on bit depth'): number of bits allocated to each channel.

- [Number of channels](../Glossary.md#channel 'internal link on channels'): number of color channels that each pixel has. Grey image has one, RGB-type of image has three.
- [Number of channels](../glossary.md#channel 'internal link on channels'): number of color channels that each pixel has. Grey image has one, RGB-type of image has three.

- [Number of components](../Glossary.md#component 'internal link on components'): number of color channels that each pixel has but without alpha channel.
- [Number of components](../glossary.md#component 'internal link on components'): number of color channels that each pixel has but without alpha channel.

- [Alpha channel](../Glossary.md#alpha-channel 'internal link on alpha-channel'): channel that represents the transparency or opacity levels of pixels.
- [Alpha channel](../glossary.md#alpha-channel 'internal link on alpha-channel'): channel that represents the transparency or opacity levels of pixels.

- [Metadata](../Glossary.md#metadata 'internal link on metadata'): data about data. A basic example would be date and time when an image was taken.
- [Metadata](../glossary.md#metadata 'internal link on metadata'): data about data. A basic example would be date and time when an image was taken.

### Features

Currently, there are several ways of processing an image:

- [Filtering](../Features/Filters/Filters.md 'internal link on filters'): filters usually apply some sort of [kernel](../Glossary.md#kernel 'internal link on kernel') to change an image.
- [Filtering](../features/filters/filters.md 'internal link on filters'): filters usually apply some sort of [kernel](../glossary.md#kernel 'internal link on kernel') to change an image.

- [Comparison](../Features/Comparison/Comparison.md 'internal link on comparison'): these features compare two images for further feature matching between the two.
- [Comparison](../features/comparison/comparison.md 'internal link on comparison'): these features compare two images for further feature matching between the two.

- [Geometry](../Features/Geometry/Geometry.md 'internal link on geometry'): this part of ImageJS allows rotating and resizing an image.
- [Geometry](../features/geometry/geometry.md 'internal link on geometry'): this part of ImageJS allows rotating and resizing an image.

- [Morphology](../Features/Morphology/Morphology.md 'internal link on morphology'): enables shape analysis and shape identification.
- [Morphology](../features/morphology/morphology.md 'internal link on morphology'): enables shape analysis and shape identification.

- [ROI analysis](../Features/Regions%20of%20interest/Regions%20of%20interest.md 'internal link on roi analysis'): these features allow targeting and extracting relevant information from specific regions of interest.
- [ROI analysis](../features/regions-of-interest/regions-of-interest.md 'internal link on roi analysis'): these features allow targeting and extracting relevant information from specific regions of interest.
Loading