Skip to content

Commit 9190508

Browse files
committed
docs: resolve conversations
1 parent f4db1f0 commit 9190508

File tree

1 file changed

+61
-46
lines changed

1 file changed

+61
-46
lines changed

blog/release.md

Lines changed: 61 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
slug: Release of a new version
3-
title: Release Notes
2+
slug: v1-release
3+
title: Release notes v1
44
date: 2025-07-19
55
---
66

@@ -10,11 +10,25 @@ We're excited to announce the release of a new major version of ImageJS. This ve
1010

1111
# API Changes
1212

13+
## 🔷 TypeScript Support
14+
15+
All APIs now have strict TypeScript definitions:
16+
17+
```ts
18+
// Before: loose typing
19+
const pixel = img.getPixel(x, y); // any[]
20+
21+
// After: strict typing
22+
const pixel = img.getPixel(x, y); // number[] with proper channel count
23+
```
24+
25+
This eliminates runtime type errors and provides better IntelliSense, autocomplete, and refactoring support in your IDE. Developers can now catch bugs at compile time rather than discovering them in production.
26+
1327
## ⚠️ Breaking changes
1428

15-
### Changes in the way images are loaded and created
29+
### Loading and saving images
1630

17-
Static method `load()` for reading and method `save()` for writing images have been replaced with dedicated functions `read()` and `write()`.
31+
`load()` and `save()` have been replaced with dedicated functions `read()` and `write()`.
1832

1933
```ts
2034
//Before
@@ -40,9 +54,24 @@ writeSync('newCat.jpg', img);
4054

4155
The new approach allows for better TypeScript inference, smaller bundle sizes through tree-shaking, and clearer API design where I/O operations are separate from image manipulation.
4256

43-
### Distinction between Image and Mask objects
57+
### Creating images
58+
59+
When creating a new image, unlike before, image's width and height must be specified.
60+
61+
```ts
62+
import { Image } from 'image-js';
63+
64+
// Would work before, will throw an error in a new version.
65+
const image = new Image();
66+
// Works fine.
67+
const image2 = new Image(10, 10);
68+
```
4469

45-
Binary images are now handled by a dedicated Mask class instead of Image with `kind: 'BINARY'`.
70+
This change makes the Image constructor more explicit by requiring you to specify the dimensions upfront, preventing potential errors from working with uninitialized or undefined-sized images
71+
72+
### Masks
73+
74+
Binary images are now handled by a dedicated `Mask` class instead of Image with `kind: 'BINARY'`.
4675

4776
```ts
4877
// Before
@@ -54,13 +83,13 @@ const mask = new Image(10, 10, { kind: 'BINARY' });
5483
const mask = new Mask(10, 10);
5584
```
5685

57-
Dedicated `Mask` class provides better type safety, clearer API, and optimized performance for binary operations.
86+
`Mask` provides better type safety, clearer API, and optimized performance for binary operations.
5887

5988
The new `Mask` class uses 1 byte per pixel (vs 8 pixels per byte), trading ~8x memory usage for significantly faster bit operations and simpler data manipulation.
6089

61-
### Modification of Sobel and Scharr filters
90+
### Sobel and Scharr filters
6291

63-
[Sobel](https://en.wikipedia.org/wiki/Sobel_operator),[Scharr](https://en.wikipedia.org/wiki/Sobel_operator#Alternative_operators) filters are now combined into a single `derivative()` method.
92+
[Sobel](https://en.wikipedia.org/wiki/Sobel_operator), [Scharr](https://en.wikipedia.org/wiki/Sobel_operator#Alternative_operators) filters are now combined into a single `derivative()` method.
6493

6594
```ts
6695
// Before
@@ -72,21 +101,7 @@ const sobelX = img.derivative({ filter: 'sobel' });
72101
const sobelY = img.derivative({ filter: 'scharr' });
73102
```
74103

75-
This filter now also accepts only grayscale images, since filters,like Sobel or Scharr, are used mainly on grayscale images to detect edges.
76-
77-
### Enhanced TypeScript Support
78-
79-
All APIs now have strict TypeScript definitions:
80-
81-
```ts
82-
ts; // Before: loose typing
83-
const pixel = img.getPixel(x, y); // any[]
84-
85-
// After: strict typing
86-
const pixel = img.getPixel(x, y); // number[] with proper channel count
87-
```
88-
89-
This eliminates runtime type errors and provides better IntelliSense, autocomplete, and refactoring support in your IDE. Developers can now catch bugs at compile time rather than discovering them in production.
104+
This filter now also accepts only grayscale images, since filters, like Sobel or Scharr, are used mainly on grayscale images to detect edges.
90105

91106
### Method Renaming
92107

@@ -110,20 +125,34 @@ Several methods have been renamed for consistency:
110125

111126
`img.getChannel()` ➡️ `img.extractChannel()`
112127

113-
Consistent naming follows common conventions (draw\* for rendering, clone for copying objects).
128+
Consistent naming follows common conventions ("draw\*" for rendering, "clone" for copying objects).
129+
130+
### Compatibility requirements
131+
132+
- Node.js: 18+ (previously 14+)
133+
- TypeScript: 5.2.2+ (if using TypeScript)
134+
135+
### Removed Features
136+
137+
The following deprecated features have been removed:
138+
139+
- `countAlphaPixel()` - Use custom pixel counting with `getPixel()`
140+
- `paintLabels()` - Feature was removed due to dependency issues. We plan to add it back in the future updates.
141+
- `warpingFourPoints()` - Use `getPerspectiveWarp()` + `transform()`.
142+
- 32-bit color depth has been currently deprecated. We plan to add it back in the future updates as well.
114143

115144
## 🆕 New Features
116145

117-
### `transform()` function
146+
### `transform()`
118147

119-
The `transform()` function allows applying transformation matrix on the image. Which means that the image can now be translated or sheared or warped based on the matrix that the user entered. `transform()` function accepts both 2x3 and 3x3 matrices, depending on whether you want an affine transformation or a perspective one.
148+
`transform()` allows applying a transformation matrix on the image. Which means that the image can now be translated, sheared, or warped based on the matrix that the user entered. `transform()` accepts both 2x3 and 3x3 matrices, depending on whether you want an affine transformation or a perspective one.
120149

121150
```ts
122151
const matrix = getPerspectiveWarp(sourcePoints);
123152
const warped = img.transform(matrix);
124153
```
125154

126-
For more details visit our [tutorial](/docs/Tutorials/Applying%20transform%20function%20on%20images) on how image transformations work.
155+
For more details, visit our [tutorial](/docs/Tutorials/Applying%20transform%20function%20on%20images) on how image transformations work.
127156

128157
### Bicubic Interpolation
129158

@@ -137,7 +166,7 @@ const resized = img.resize(800, 600, { interpolation: 'bicubic' });
137166

138167
### Canny Edge Detection
139168

140-
[Canny Edge Detector](https://en.wikipedia.org/wiki/Canny_edge_detector) is an advanced edge detection filter for computer vision applications:
169+
[The Canny Edge Detector](https://en.wikipedia.org/wiki/Canny_edge_detector) is an advanced edge detection filter for computer vision applications:
141170

142171
```ts
143172
const edges = img.cannyEdgeDetector({
@@ -158,9 +187,9 @@ const prewitt = img.derivative({ filter: 'prewitt' });
158187

159188
**Use case**: Object detection, image segmentation, feature extraction. You can learn more about it [here](../docs/Features/Morphology/Morphological%20Gradient).
160189

161-
### Migration from deprecated methods:
190+
### Migration from deprecated methods
162191

163-
`warpingFourPoints()` function has been deprecated. Now you have [`getPerspectiveWarp()`](../docs/Features/Geometry/Get%20Perspective%20Warp%20Matrix) function that returns a matrix that can be applied on an image of interest in a new `transform()` function.
192+
`warpingFourPoints()` has been deprecated. Now you have [`getPerspectiveWarp()`](../docs/Features/Geometry/Get%20Perspective%20Warp%20Matrix) that returns a matrix that can be applied on the image of interest in a new `transform()`.
164193

165194
```ts
166195
// Before
@@ -173,23 +202,9 @@ const warped = img.transform(matrix);
173202

174203
**Use case**: Rectification of a perspective angle of an image. You can learn more about it [here](../docs/Features/Geometry/Get%20Perspective%20Warp%20Matrix).
175204

176-
## 🗑️ Removed Features
177-
178-
The following deprecated features have been removed:
179-
180-
- `countAlphaPixel()` - Use custom pixel counting with `getPixel()`
181-
- `paintLabels()` - Feature was removed due to dependency issues. We plan to add it back in the future updates.
182-
- `warpingFourPoints()` - Use `getPerspectiveWarp()` + `transform()`.
183-
- 32-bit color depth has been currently deprecated. We plan to add it back in the future updates as well.
184-
185-
## 🔧 Compatibility & Requirements
186-
187-
- Node.js: 18+ (previously 14+)
188-
- TypeScript: 5.2.2+ (if using TypeScript)
189-
190205
## 🚀 Getting Started
191206

192-
To get started with ImageJS, we recommend visiting our [\"Get started\"](../docs/Getting%20started) guide
207+
To get started with ImageJS, we recommend visiting our ["Get started"](../docs/Getting%20started) guide
193208

194209
## 📚 Resources
195210

0 commit comments

Comments
 (0)