@thi.ng/pixel-dither 1.1.135 → 1.1.136

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2024-07-19T14:56:21Z
3
+ - **Last updated**: 2024-07-22T13:15:57Z
4
4
  - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
5
5
 
6
6
  All notable changes to this project will be documented in this file.
@@ -9,6 +9,12 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
9
9
  **Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
10
10
  and/or version bumps of transitive dependencies.
11
11
 
12
+ ### [1.1.136](https://github.com/thi-ng/umbrella/tree/@thi.ng/pixel-dither@1.1.136) (2024-07-22)
13
+
14
+ #### ♻️ Refactoring
15
+
16
+ - update imports ([a748565](https://github.com/thi-ng/umbrella/commit/a748565))
17
+
12
18
  ### [1.1.131](https://github.com/thi-ng/umbrella/tree/@thi.ng/pixel-dither@1.1.131) (2024-06-21)
13
19
 
14
20
  #### ♻️ Refactoring
package/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  [![Mastodon Follow](https://img.shields.io/mastodon/follow/109331703950160316?domain=https%3A%2F%2Fmastodon.thi.ng&style=social)](https://mastodon.thi.ng/@toxi)
8
8
 
9
9
  > [!NOTE]
10
- > This is one of 189 standalone projects, maintained as part
10
+ > This is one of 198 standalone projects, maintained as part
11
11
  > of the [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo
12
12
  > and anti-framework.
13
13
  >
@@ -75,7 +75,7 @@ For Node.js REPL:
75
75
  const pd = await import("@thi.ng/pixel-dither");
76
76
  ```
77
77
 
78
- Package sizes (brotli'd, pre-treeshake): ESM: 1.05 KB
78
+ Package sizes (brotli'd, pre-treeshake): ESM: 1.06 KB
79
79
 
80
80
  ## Dependencies
81
81
 
@@ -100,10 +100,11 @@ directory are using this package:
100
100
  [Generated API docs](https://docs.thi.ng/umbrella/pixel-dither/)
101
101
 
102
102
  ```ts
103
- import { intBufferFromImage, GRAY8 } from "@thi.ng/pixel";
103
+ import { imageFromURL, intBufferFromImage, GRAY8 } from "@thi.ng/pixel";
104
104
  import { ditherWith, ATKINSON } from "@thi.ng/pixel-dither";
105
105
 
106
- const img = intBufferFromImage("foo.jpg");
106
+ // create pixel buffer from HTML image element
107
+ const img = intBufferFromImage(await imageFromURL("test.jpg"));
107
108
 
108
109
  // apply dithering to all channels in given pixel buffer
109
110
  ditherWith(ATKINSON, img);
package/dither.js CHANGED
@@ -1,10 +1,10 @@
1
- import { range } from "@thi.ng/pixel/range";
1
+ import { __range } from "@thi.ng/pixel/internal/range";
2
2
  const ditherWith = (kernel, img, opts = {}) => {
3
3
  const { bleed = 1, threshold = 0.5, channels } = opts;
4
4
  const { format, width, height } = img;
5
5
  const { ox, oy, weights, shift } = kernel;
6
6
  let p, err;
7
- for (let cid of channels || range(format.channels.length)) {
7
+ for (let cid of channels || __range(format.channels.length)) {
8
8
  const cimg = img.getChannel(cid);
9
9
  const chan = format.channels[cid];
10
10
  const $thresh = chan.num * threshold;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/pixel-dither",
3
- "version": "1.1.135",
3
+ "version": "1.1.136",
4
4
  "description": "Extensible image dithering w/ various algorithm presets",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -36,9 +36,9 @@
36
36
  "tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
37
37
  },
38
38
  "dependencies": {
39
- "@thi.ng/checks": "^3.6.8",
40
- "@thi.ng/math": "^5.11.4",
41
- "@thi.ng/pixel": "^6.1.37"
39
+ "@thi.ng/checks": "^3.6.9",
40
+ "@thi.ng/math": "^5.11.5",
41
+ "@thi.ng/pixel": "^7.0.0"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@microsoft/api-extractor": "^7.47.0",
@@ -105,5 +105,5 @@
105
105
  "parent": "@thi.ng/pixel",
106
106
  "year": 2021
107
107
  },
108
- "gitHead": "c7aaa453b01a45e5235517db9d2a283b97abac96\n"
108
+ "gitHead": "324d6b7dbf31558329e9fb6452e29b2f7db9c61a\n"
109
109
  }