Skip to content

Commit 1d44870

Browse files
committed
docs wip add a page about image-js-typescript release
1 parent ac88bd0 commit 1d44870

File tree

4 files changed

+4353
-3753
lines changed

4 files changed

+4353
-3753
lines changed

blog/release.md

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
---
2+
slug: Release of a new version
3+
title: Release Notes
4+
date: 2024-01-15
5+
authors: [maxim]
6+
tags: [release]
7+
---
8+
9+
We're excited to announce the release of image-js-typescript, a complete rewrite of the popular image-js library. This new version brings modern TypeScript support and a more intuitive API while maintaining the powerful image processing capabilities you love.
10+
11+
## ⚠️ API Changes
12+
13+
### Stricter typing
14+
15+
```js
16+
// Before
17+
const pixel = img.getPixel(x, y); // any[]
18+
19+
// After
20+
const pixel = img.getPixel(x, y); // number[] with proper typing
21+
```
22+
23+
### Changed the way images are loaded and created
24+
25+
Static method `load` for reading and writing images has been replaced with dedicated functions `read` and `write`. There are also synchronous versions of these functions.(add more explanation)
26+
27+
```ts
28+
javascript; // Before
29+
import { Image } from 'image-js';
30+
const img = await Image.load('cat.jpg');
31+
```
32+
33+
```ts
34+
// After
35+
import { readSync, read } from 'image-js';
36+
const img = readSync('cat.jpg');
37+
// or
38+
const img = await read('cat.jpg');
39+
```
40+
41+
### Distinction between Image and Mask objects
42+
43+
In the new version of ImageJS binary images(masks) becomes a separate class.
44+
45+
```ts
46+
// Before
47+
const mask = new Image(10, 10, { kind: 'BINARY' });
48+
```
49+
50+
```ts
51+
// After
52+
const mask = new Mask(10, 10);
53+
```
54+
55+
In previous versions binary images (masks) had 8 pixels of data stacked in one byte.The new version changes that. Now Masks' data reserves 1 byte per pixel.
56+
It improves and facilitates data readability and editing.
57+
58+
### New features
59+
60+
- Bicubic interpolation has been added as interpolation option
61+
- Canny Edge Detector filter has been added
62+
- `transform` function now accepts 3x3 matrices as well as 2x3
63+
- `warpingFourPoints` function has been deprecated and now `getPerspectiveWarp` returns a matrix that can be used in a new `transform()` function.
64+
65+
### Refactored functions
66+
67+
Several methods have been renamed. Some notable changes:
68+
69+
- `paint*` methods(`drawPoligon()`, `paintPolyline()` etc.) are now `draw\*` methods(`drawPolyline()`,`drawPoligon()` etc.).
70+
- `copy()``clone()`
71+
- `clearBit()``setBit()`,`setBitByPoint()`,`setBitByCoord()`
72+
- `getLocalMaxima``getExtrema`
73+
- `getChannel()``extractChannel()`
74+
75+
### Bug fixes
76+
77+
- Fixed perspectiveWarp functioning
78+
79+
### Removed Features
80+
81+
- `countAlphaPixel` was removed.
82+
- `paintLabels` was removed.
83+
84+
### Configuration Changes
85+
86+
Default parameters: Some filter defaults have changed for better results
87+
Color space handling: Improved but different color space conversion behavior
88+
89+
## 📚 Resources
90+
91+
[API Documentation](https://image-js.github.io/image-js-typescript/)
92+
[Examples and Tutorials](https://image-js-docs.pages.dev/)
93+
[GitHub Repository](https://github.com/image-js/image-js-typescript)
94+
95+
## 🤝 Contributing
96+
97+
We welcome contributions! The new TypeScript codebase makes it easier than ever to contribute. Check out our contributing guide to get started.
98+
99+
## 🙏 Acknowledgments
100+
101+
Special thanks to all contributors who made this release possible and to the community for their feedback and support during the development process.
102+
103+
Ready to upgrade? Check out our migration guide to get started with image-js-typescript today!

docusaurus.config.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,12 @@ const config = {
9494
},
9595
blog: {
9696
showReadingTime: true,
97+
blogTitle: 'Docusaurus blog!',
98+
blogDescription: 'A Docusaurus powered blog!',
99+
postsPerPage: 'ALL',
97100
// Please change this to your repo.
98101
// Remove this to remove the "edit this page" links.
99-
editUrl:
100-
'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
102+
editUrl: 'https://github.com/image-js/image-js-docs/tree/main/',
101103
},
102104
theme: {
103105
customCss: require.resolve('./src/css/custom.css'),
@@ -132,6 +134,7 @@ const config = {
132134
position: 'left',
133135
label: 'Docs',
134136
},
137+
{ to: '/blog', label: 'Blog', position: 'left' },
135138
{
136139
href: 'https://image-js.github.io/image-js-typescript/',
137140
label: 'API reference',

0 commit comments

Comments
 (0)